can: mcba_usb: fix device disconnect bug
authorMartin Kelly <mkelly@xevo.com>
Mon, 27 Nov 2017 23:49:16 +0000 (15:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:52:45 +0000 (09:52 +0100)
commitba4eed1bd4d82ed591f07eee628b1efade7e6764
tree0204ea045efc189a325d4346f862c8d6d729455b
parent4dc9c1cfa9fffed0ec812a85e4b06a68efb6afea
can: mcba_usb: fix device disconnect bug

commit 1cb35a33a28394fd711bb26ddf3a564f4e9d9125 upstream.

Currently, when you disconnect the device, the driver infinitely
resubmits all URBs, so you see:

Rx URB aborted (-32)

in an infinite loop.

Fix this by catching -EPIPE (what we get in urb->status when the device
disconnects) and not resubmitting.

With this patch, I can plug and unplug many times and the driver
recovers correctly.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/usb/mcba_usb.c