From: Igor Kotrasinski Date: Mon, 21 Sep 2015 09:30:45 +0000 (+0200) Subject: usbip: vhci_hcd: at unlink, return -EIDRM if vhci_rx took the urb X-Git-Tag: KARO-TX6UL-2015-11-03~36^2~35 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=635e664a6b4d4b9c12f507045d156ea419b62dff;p=karo-tx-linux.git usbip: vhci_hcd: at unlink, return -EIDRM if vhci_rx took the urb In a situation where the urb is about to be returned or was never there, we should return -EIDRM (as per usb_hcd_check_unlink_urb). This is exactly the situation when the urb is picked up by vhci_rx before we access priv. Return -EIDRM rather than 0 when this happens. Signed-off-by: Igor Kotrasinski Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 51145cf92860..7fbe19d5279e 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -631,7 +631,7 @@ static int vhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) /* URB was never linked! or will be soon given back by * vhci_rx. */ spin_unlock(&the_controller->lock); - return 0; + return -EIDRM; } {