]> git.baikalelectronics.ru Git - kernel.git/commit
bnx2: Fix hang during rmmod bnx2.
authorMichael Chan <mchan@broadcom.com>
Tue, 1 Jun 2010 15:05:36 +0000 (15:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jun 2010 09:26:40 +0000 (02:26 -0700)
commit7aceef3890cef825259c972805de54b3ae61690b
treec68dd0cc095559c348c8916b6e3372b4e0610e9a
parent6c2007b2d549d00bd056c72984096eaca804e902
bnx2: Fix hang during rmmod bnx2.

The regression is caused by:

commit 494f892aebfdaf9c947f77e4d66084ad0dde192f
    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>
drivers/net/bnx2.c