]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usbip: vudc: fix: Clear already_seen flag also for ep0
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Thu, 1 Dec 2016 18:14:37 +0000 (19:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jan 2017 09:40:11 +0000 (10:40 +0100)
commit 3e448e13a662fb20145916636127995cbf37eb83 upstream.

ep_list inside gadget structure doesn't contain ep0.
It is stored separately in ep0 field.

This causes an urb hang if gadget driver decides to
delay setup handling. On host side this is visible as
timeout error when setting configuration.

This bug can be reproduced using for example any gadget
with mass storage function.

Fixes: abdb29574322 ("usbip: vudc: Add vudc_transfer")
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/vudc_transfer.c

index aba6bd478045113524935ccdd0055ffb4996e9eb..bc0296d937d0f628c16a04a544b14321a281af8c 100644 (file)
@@ -339,6 +339,8 @@ static void v_timer(unsigned long _vudc)
                total = timer->frame_limit;
        }
 
+       /* We have to clear ep0 flags separately as it's not on the list */
+       udc->ep[0].already_seen = 0;
        list_for_each_entry(_ep, &udc->gadget.ep_list, ep_list) {
                ep = to_vep(_ep);
                ep->already_seen = 0;