Re: [PATCH] usb: gadget: udc-core: Race between disconnect/unbind and setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Some gadget drivers, such as composite, assume this will never happen
> and crash as a result.
>
> The fix is to quiesce the UDC hardware (via usb_gadget_disconnect)
> before running the gadget driver through the disconnect/unbind sequence.
>
> Signed-off-by: Kevin Cernekee <cernekee@xxxxxxxxx>
> ---
>  drivers/usb/gadget/udc-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
> index e5e44f8..bae243c 100644
> --- a/drivers/usb/gadget/udc-core.c
> +++ b/drivers/usb/gadget/udc-core.c
> @@ -262,8 +262,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
>         kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);
>
>         if (udc_is_newstyle(udc)) {
> -               udc->driver->disconnect(udc->gadget);
>                 usb_gadget_disconnect(udc->gadget);
> +               udc->driver->disconnect(udc->gadget);
>                 udc->driver->unbind(udc->gadget);
>                 usb_gadget_udc_stop(udc->gadget, udc->driver);
>         } else {
> --
> 1.7.11.1
>
Reviewed-by: Peter Chen <peter.chen@xxxxxxxxxxxxx>

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux