summaryrefslogtreecommitdiffstats
path: root/drivers/usb/usbip/vhci_hcd.c
diff options
context:
space:
mode:
authorIgor Kotrasinski <i.kotrasinsk@samsung.com>2015-09-21 11:30:44 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 10:59:03 +0100
commit03b0a52822fec8fba351fd472f3adda6fd760e77 (patch)
treec2f6f91981e0f2defa1bef065e741fff5dd65a83 /drivers/usb/usbip/vhci_hcd.c
parent0c43e9d835b003d862a5f76e3affcc1f973fb3c0 (diff)
downloadlinux-stable-03b0a52822fec8fba351fd472f3adda6fd760e77.tar.gz
linux-stable-03b0a52822fec8fba351fd472f3adda6fd760e77.tar.bz2
linux-stable-03b0a52822fec8fba351fd472f3adda6fd760e77.zip
usbip: vhci_hcd: only return urb at enqueue when served
We handle USB_REQ_SET_ADDRESS at enqueue, so we want to perform cleanup and giveback the urb. We should not call usb_hcd_giveback_urb when we're cleaning up after a failed enqueue, though. Only giveback the urb at cleanup when we claim to have served it. Signed-off-by: Igor Kotrasinski <i.kotrasinsk@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip/vhci_hcd.c')
-rw-r--r--drivers/usb/usbip/vhci_hcd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 42c82317f15e..51145cf92860 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -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;
}