From: Alexander Stein Date: Tue, 27 Nov 2012 07:52:34 +0000 (+0100) Subject: can: Do not call dev_put if restart timer is running upon close X-Git-Tag: v3.2.36~85 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6b0ca703b31fcff8dffc856d9a1b57ead5e0439a;p=karo-tx-linux.git can: Do not call dev_put if restart timer is running upon close commit ab48b03ec9ae1840a1e427e2375bd0d9d554b4ed upstream. If the restart timer is running due to BUS-OFF and the device is disconnected an dev_put will decrease the usage counter to -1 thus blocking the interface removal, resulting in the following dmesg lines repeating every 10s: can: notifier: receive list not found for dev can0 can: notifier: receive list not found for dev can0 can: notifier: receive list not found for dev can0 unregister_netdevice: waiting for can0 to become free. Usage count = -1 Signed-off-by: Alexander Stein Signed-off-by: Marc Kleine-Budde Signed-off-by: Ben Hutchings --- diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 25695bde0549..a3190574c3e6 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -569,8 +569,7 @@ void close_candev(struct net_device *dev) { struct can_priv *priv = netdev_priv(dev); - if (del_timer_sync(&priv->restart_timer)) - dev_put(dev); + del_timer_sync(&priv->restart_timer); can_flush_echo_skb(dev); } EXPORT_SYMBOL_GPL(close_candev);