Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

USB: usbip: fix stub_dev hub disconnect

If a hub is disconnected that has device(s) that's attached to the usbip layer
the disconnect function might fail because it tries to release the port
on an already disconnected hub.

Fixes: 6080cd0e9239 ("staging: usbip: claim ports used by shared devices")
Signed-off-by: Jonas Blixt <jonas.blixt@actia.se>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230615092810.1215490-1-jonas.blixt@actia.se
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jonas Blixt and committed by
Greg Kroah-Hartman
97475763 1053c4a4

+7 -2
+7 -2
drivers/usb/usbip/stub_dev.c
··· 464 464 /* release port */ 465 465 rc = usb_hub_release_port(udev->parent, udev->portnum, 466 466 (struct usb_dev_state *) udev); 467 - if (rc) { 468 - dev_dbg(&udev->dev, "unable to release port\n"); 467 + /* 468 + * NOTE: If a HUB disconnect triggered disconnect of the down stream 469 + * device usb_hub_release_port will return -ENODEV so we can safely ignore 470 + * that error here. 471 + */ 472 + if (rc && (rc != -ENODEV)) { 473 + dev_dbg(&udev->dev, "unable to release port (%i)\n", rc); 469 474 return; 470 475 } 471 476