bnx2x: fix possible overrun of VFPF multicast addresses array
authorMichal Schmidt <mschmidt@redhat.com>
Fri, 3 Mar 2017 16:08:30 +0000 (17:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Mar 2017 21:47:15 +0000 (13:47 -0800)
commit22118d861cec5da6ed525aaf12a3de9bfeffc58f
tree229ab2058dae31cd20c3c8e27906f1ea583a360e
parent850268d320f0c7c5eb7ad0a62ef21859fa331ded
bnx2x: fix possible overrun of VFPF multicast addresses array

It is too late to check for the limit of the number of VF multicast
addresses after they have already been copied to the req->multicast[]
array, possibly overflowing it.

Do the check before copying.

Also fix the error path to not skip unlocking vf2pf_mutex.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c