usb: udc: core: fix error handling
The udc device needs to be deleted if error occurs
Fixes: 855ed04a37
("usb: gadget: udc-core: independent registration of
gadgets and gadget drivers")
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Родитель
7442e6db5b
Коммит
17a1dc5e22
|
@ -1145,7 +1145,7 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
|
|||
if (ret != -EPROBE_DEFER)
|
||||
list_del(&driver->pending);
|
||||
if (ret)
|
||||
goto err4;
|
||||
goto err5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1154,6 +1154,9 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
|
|||
|
||||
return 0;
|
||||
|
||||
err5:
|
||||
device_del(&udc->dev);
|
||||
|
||||
err4:
|
||||
list_del(&udc->list);
|
||||
mutex_unlock(&udc_lock);
|
||||
|
|
Загрузка…
Ссылка в новой задаче