summaryrefslogtreecommitdiff
path: root/drivers/net/can/usb
diff options
context:
space:
mode:
authorMartin Kelly <mkelly@xevo.com>2017-11-28 02:49:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-14 11:52:45 +0300
commitba4eed1bd4d82ed591f07eee628b1efade7e6764 (patch)
tree0204ea045efc189a325d4346f862c8d6d729455b /drivers/net/can/usb
parent4dc9c1cfa9fffed0ec812a85e4b06a68efb6afea (diff)
downloadlinux-ba4eed1bd4d82ed591f07eee628b1efade7e6764.tar.xz
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>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r--drivers/net/can/usb/mcba_usb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c
index 7f0272558bef..a884d31fe324 100644
--- a/drivers/net/can/usb/mcba_usb.c
+++ b/drivers/net/can/usb/mcba_usb.c
@@ -592,6 +592,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb)
break;
case -ENOENT:
+ case -EPIPE:
case -ESHUTDOWN:
return;