bnx2x: Protect against VFs' ndos when SR-IOV is disabled
authorAriel Elior <ariele@broadcom.com>
Mon, 19 Aug 2013 06:12:00 +0000 (09:12 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Aug 2013 07:21:47 +0000 (00:21 -0700)
commit5ae30d78042ab7790c40b530153c8fdabe1c0ee1
tree17f917d9b23ce1f98fbdf72dd1b32a08b106abe4
parentaeeddb8b9e76d1f250d58b40e8dba8614d61368b
bnx2x: Protect against VFs' ndos when SR-IOV is disabled

Since SR-IOV can be activated dynamically and iproute2 can be called
asynchronously, the various callbacks need a robust sanity check before
attempting to access the SR-IOV database and members since there are numerous
states in which it can find the driver (e.g., PF is down, sriov was not enabled
yet, VF is down, etc.).

In many of the states the callback result will be null pointer dereference.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c