> -----Original Message-----
> From: Robert Baldyga [mailto:r.bald...@samsung.com]
> Sent: Friday, December 12, 2014 2:17 PM
> To: ba...@ti.com
> Cc: gre...@linuxfoundation.org; peter.c...@freescale.com; linux-
> u...@vger.kernel.org; linux-ker...@vger.kernel.org;
> m.szyprow...@samsung.com; k.opas...@samsung.com; Robert Baldyga
> Subject: [PATCH] usb: gadget: udc-core: call udc_stop() before
> gadget unbind
> 
> As usb function drivers assumes that all usb request will be
> completed
> before function unbind call, we should supply such behavior. In
> some
> cases ep_disable() won't kill all request effectively, because some
> IN requests can be in running state. In such situation it's
> possible
> to have unbind function called before last request completion,
> which
> can cause problems.
> 
> For example unbinding f_ecm function while request on 'notify'
> endpoint
> is not completed, ends up NULL pointer dereference in unbind()
> function.
> 
> usb_gadget_udc_stop() call causes completion of all requests so if
> it's
> called before gadget unbind there is no risk that some of requests
> will
> stay uncompleted.
> 
> Signed-off-by: Robert Baldyga <r.bald...@samsung.com>

This finally solves issue described before in [1]

Tested-by: Krzysztof Opasiak <k.opas...@samsung.com>

Footnotes:
1 - https://lkml.org/lkml/2014/12/9/283

-- 
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
k.opas...@samsung.com




--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to