]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usbip: vhci_hcd: at unlink, return -EIDRM if vhci_rx took the urb
authorIgor Kotrasinski <i.kotrasinsk@samsung.com>
Mon, 21 Sep 2015 09:30:45 +0000 (11:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Oct 2015 09:59:03 +0000 (10:59 +0100)
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 <i.kotrasinsk@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/vhci_hcd.c

index 51145cf92860d665ac6734c2996d61d727994d50..7fbe19d5279e5c11159f141fdd20b6a3ac7ff568 100644 (file)
@@ -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;
        }
 
        {