bnx2: Fix hang during rmmod bnx2.
commit8bffdea32019685abb0ad2035ab5870eecb887d4
authorMichael Chan <mchan@broadcom.com>
Tue, 1 Jun 2010 15:05:36 +0000 (1 15:05 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:30:17 +0000 (2 10:30 -0700)
tree474b9962a8930a2e6ec6240a190563d28796b2e5
parent131637b6e8287c90239ce1e5e6311d2e93986bce
bnx2: Fix hang during rmmod bnx2.

commit f048fa9c8686119c3858a463cab6121dced7c0bf upstream.

The regression is caused by:

commit 4327ba435a56ada13eedf3eb332e583c7a0586a9
    bnx2: Fix netpoll crash.

If ->open() and ->close() are called multiple times, the same napi structs
will be added to dev->napi_list multiple times, corrupting the dev->napi_list.
This causes free_netdev() to hang during rmmod.

We fix this by calling netif_napi_del() during ->close().

Also, bnx2_init_napi() must not be in the __devinit section since it is
called by ->open().

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