Skip to content

Commit

Permalink
can: Do not call dev_put if restart timer is running upon close
Browse files Browse the repository at this point in the history
commit ab48b03 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 <alexander.stein@systec-electronic.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alexander Stein authored and Greg Kroah-Hartman committed Jan 11, 2013
1 parent c0c7cf2 commit 4ca05c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,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);
Expand Down

0 comments on commit 4ca05c8

Please sign in to comment.