Revert "BACKPORT: FROMGIT: usb: gadget: udc: Handle gadget_connect failure during bind operation"
This reverts commit 251aa28d16
.
Reason for revert: b/301670242
The connect_lock mutex is not being released in error path. This patch was reverted upstream.
Signed-off-by: Neill Kapron <nkapron@google.com>
Change-Id: I802a9a8afc9f23b1bf91fa4df4bfb5d207373b04
This commit is contained in:
parent
ae5ea9043d
commit
b374d94195
@ -1099,16 +1099,12 @@ EXPORT_SYMBOL_GPL(usb_gadget_set_state);
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Acquire connect_lock before calling this function. */
|
||||
static int usb_udc_connect_control_locked(struct usb_udc *udc) __must_hold(&udc->connect_lock)
|
||||
static void usb_udc_connect_control_locked(struct usb_udc *udc) __must_hold(&udc->connect_lock)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (udc->vbus)
|
||||
ret = usb_gadget_connect_locked(udc->gadget);
|
||||
usb_gadget_connect_locked(udc->gadget);
|
||||
else
|
||||
ret = usb_gadget_disconnect_locked(udc->gadget);
|
||||
|
||||
return ret;
|
||||
usb_gadget_disconnect_locked(udc->gadget);
|
||||
}
|
||||
|
||||
static void vbus_event_work(struct work_struct *work)
|
||||
@ -1582,21 +1578,12 @@ static int gadget_bind_driver(struct device *dev)
|
||||
}
|
||||
usb_gadget_enable_async_callbacks(udc);
|
||||
udc->allow_connect = true;
|
||||
ret = usb_udc_connect_control_locked(udc);
|
||||
if (ret)
|
||||
goto err_connect_control;
|
||||
|
||||
usb_udc_connect_control_locked(udc);
|
||||
mutex_unlock(&udc->connect_lock);
|
||||
|
||||
kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);
|
||||
return 0;
|
||||
|
||||
err_connect_control:
|
||||
usb_gadget_disable_async_callbacks(udc);
|
||||
if (gadget->irq)
|
||||
synchronize_irq(gadget->irq);
|
||||
usb_gadget_udc_stop_locked(udc);
|
||||
|
||||
err_start:
|
||||
driver->unbind(udc->gadget);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user