can: Do not call dev_put if restart timer is running upon close
authorAlexander Stein <alexander.stein@systec-electronic.com>
Tue, 27 Nov 2012 07:52:34 +0000 (08:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Jan 2013 17:03:50 +0000 (09:03 -0800)
commita0ed2e748abaf7f31e6a2e8129efa461a4181277
treef1055fd35b4690c5c6d39f92bfc716d113b8f39d
parentc39096f1ae6551a0d43b84cb5dad309f0d392a38
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 <alexander.stein@systec-electronic.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/dev.c