bnx2x: Prevent null pointer dereference in AFEX mode
authorYuval Mintz <yuvalmin@broadcom.com>
Wed, 10 Apr 2013 10:34:39 +0000 (13:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Apr 2013 19:27:04 +0000 (15:27 -0400)
commitfea75645342c7ad574214497a78e562db12dfd7b
treebca5264257c1fa9ae2c00172f01bac66712ab031
parent61a0f6efc8932e9914e1782ff3a027e23c687fc6
bnx2x: Prevent null pointer dereference in AFEX mode

The cnic module is responsible for initializing various bnx2x structs
via callbacks provided by the bnx2x module.
One such struct is the queue object for the FCoE queue.

If a device is working in AFEX mode and its configuration allows FCoE yet
the cnic module is not loaded, it's very likely a null pointer dereference
will occur, as the bnx2x will erroneously access the FCoE's queue object.

Prevent said access until cnic properly registers itself.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@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_main.c