diff options
author | Neil Horman <nhorman@tuxdriver.com> | 2010-10-13 12:01:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-18 11:32:08 -0400 |
commit | 3b410a310b48a8e7de3438957635093596ad5ca5 (patch) | |
tree | 494176f29fb9bb1a6126319a843403a9e850f73e /drivers/net/netconsole.c | |
parent | 990c3d6f9c4115347659fc2b163907c8c832ae44 (diff) |
bonding: Fix netconsole to not deadlock on rmmod
Netconsole calls netpoll_cleanup on receipt of a NETDEVICE_UNREGISTER event.
The notifier subsystem calls these event handlers with rtnl_lock held, which
netpoll_cleanup also takes, resulting in deadlock. Fix this by calling the
__netpoll_cleanup interior function instead, and fixing up the additional
pointers.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r-- | drivers/net/netconsole.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index ca142c47b2e4..94255f09093d 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -678,7 +678,14 @@ static int netconsole_netdev_event(struct notifier_block *this, | |||
678 | strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); | 678 | strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); |
679 | break; | 679 | break; |
680 | case NETDEV_UNREGISTER: | 680 | case NETDEV_UNREGISTER: |
681 | netpoll_cleanup(&nt->np); | 681 | /* |
682 | * rtnl_lock already held | ||
683 | */ | ||
684 | if (nt->np.dev) { | ||
685 | __netpoll_cleanup(&nt->np); | ||
686 | dev_put(nt->np.dev); | ||
687 | nt->np.dev = NULL; | ||
688 | } | ||
682 | /* Fall through */ | 689 | /* Fall through */ |
683 | case NETDEV_GOING_DOWN: | 690 | case NETDEV_GOING_DOWN: |
684 | case NETDEV_BONDING_DESLAVE: | 691 | case NETDEV_BONDING_DESLAVE: |