can: mcba_usb: fix device disconnect bug
authorMartin Kelly <mkelly@xevo.com>
Mon, 27 Nov 2017 23:49:16 +0000 (15:49 -0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 1 Dec 2017 10:27:14 +0000 (11:27 +0100)
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>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/mcba_usb.c

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