Skip to content

Commit

Permalink
can: mcba_usb: fix device disconnect bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Martin Kelly authored and Marc Kleine-Budde committed Dec 1, 2017
1 parent 3fed8db commit 1cb35a3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/can/usb/mcba_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ static void mcba_usb_read_bulk_callback(struct urb *urb)
break;

case -ENOENT:
case -EPIPE:
case -ESHUTDOWN:
return;

Expand Down

0 comments on commit 1cb35a3

Please sign in to comment.