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)
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

index 7f0272558befe9ecdeaf110d2b95f8754cea8939..a884d31fe324c93d1622b3debe3cdd493bf69680 100644 (file)
@@ -592,6 +592,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb)
                break;
 
        case -ENOENT:
+       case -EPIPE:
        case -ESHUTDOWN:
                return;