Message ID | 1286920552-2173-5-git-send-email-nhorman@tuxdriver.com |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index ca142c4..94255f0 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -678,7 +678,14 @@ static int netconsole_netdev_event(struct notifier_block *this, strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ); break; case NETDEV_UNREGISTER: - netpoll_cleanup(&nt->np); + /* + * rtnl_lock already held + */ + if (nt->np.dev) { + __netpoll_cleanup(&nt->np); + dev_put(nt->np.dev); + nt->np.dev = NULL; + } /* Fall through */ case NETDEV_GOING_DOWN: case NETDEV_BONDING_DESLAVE: