]> git.karo-electronics.de Git - karo-tx-linux.git/commit
bnx2: Fix netpoll crash.
authorBenjamin Li <benli@broadcom.com>
Tue, 23 Mar 2010 13:13:11 +0000 (13:13 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 27 Sep 2010 00:21:32 +0000 (17:21 -0700)
commit508d1ab51e66eb8f50acba0301524b09babe37b3
tree3a1c5a2482d5957ba211bc9ca8754abafe42e990
parent06f796fb6a720e5b3b56d0ba08c968d82a48f60b
bnx2: Fix netpoll crash.

commit 4327ba435a56ada13eedf3eb332e583c7a0586a9 upstream.

The bnx2 driver calls netif_napi_add() for all the NAPI structs during
->probe() time but not all of them will be used if we're not in MSI-X
mode.  This creates a problem for netpoll since it will poll all the
NAPI structs in the dev_list whether or not they are scheduled, resulting
in a crash when we access structure fields not initialized for that vector.

We fix it by moving the netif_napi_add() call to ->open() after the number
of IRQ vectors has been determined.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/bnx2.c