usbip: vhci_hcd: only return urb at enqueue when served
[cascardo/linux.git] / drivers / usb / usbip / vhci_hcd.c
index 42c8231..51145cf 100644 (file)
@@ -565,7 +565,9 @@ no_need_xmit:
        usb_hcd_unlink_urb_from_ep(hcd, urb);
 no_need_unlink:
        spin_unlock(&the_controller->lock);
-       usb_hcd_giveback_urb(vhci_to_hcd(the_controller), urb, urb->status);
+       if (!ret)
+               usb_hcd_giveback_urb(vhci_to_hcd(the_controller),
+                                    urb, urb->status);
        return ret;
 }