bnx2x: Prevent NULL pointer dereference in kdump
authorYuval Mintz <yuvalmin@broadcom.com>
Mon, 22 Apr 2013 02:53:03 +0000 (02:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Apr 2013 08:00:56 +0000 (04:00 -0400)
commitecf01c22be034690b621d92c9ff488d607a9995a
treee05899b77655c080a421f33fddebc396c582d6b8
parente56db277684895184bc74fcf74f7ef993e3a5b6c
bnx2x: Prevent NULL pointer dereference in kdump

In scenarios in which a previous driver was removed without proper cleanup
(e.g., kdump), it is possible for the chip to generate an interrupt without
any apparent reason once interrupts are requested.

Due to an erroneous initialization of resources, some of the bnx2x structs
which are required for interrupt handling are initialized only after an
interface's interrupt is requested from the OS.

As a result, once such a spurious interrupt occurs, it will cause a NULL
pointer dereference - the driver will access those structs in its interrupt
handling routine.

This patch change the interrupt request scheme so that bnx2x would only
request interrupts from the kernel after it has finished initializing
all the inner structs required for interrupt handling.

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_cmn.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c