提交 03b0a528 编写于 作者: I Igor Kotrasinski 提交者: Greg Kroah-Hartman

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: NIgor Kotrasinski <i.kotrasinsk@samsung.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 0c43e9d8
...@@ -565,7 +565,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, ...@@ -565,7 +565,9 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
usb_hcd_unlink_urb_from_ep(hcd, urb); usb_hcd_unlink_urb_from_ep(hcd, urb);
no_need_unlink: no_need_unlink:
spin_unlock(&the_controller->lock); 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; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册