Message ID | 20200305015502.28927-1-peter.chen@kernel.org |
---|---|
State | New |
Headers | show |
Series | [1/1] usb: chipidea: udc: fix sleeping function called from invalid context | expand |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 94feaecc6059..9d74fe856ce8 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1601,9 +1601,11 @@ static void ci_hdrc_gadget_connect(struct usb_gadget *_gadget, int is_active) if (ci->driver) { hw_device_state(ci, ci->ep0out->qh.dma); usb_gadget_set_state(_gadget, USB_STATE_POWERED); + spin_unlock_irqrestore(&ci->lock, flags); usb_udc_vbus_handler(_gadget, true); + } else { + spin_unlock_irqrestore(&ci->lock, flags); } - spin_unlock_irqrestore(&ci->lock, flags); } else { usb_udc_vbus_handler(_gadget, false); if (ci->driver)