From: Martin Kelly Date: Mon, 27 Nov 2017 23:49:16 +0000 (-0800) Subject: can: mcba_usb: fix device disconnect bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ba4eed1bd4d82ed591f07eee628b1efade7e6764;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- 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;