提交 17a1dc5e 编写于 作者: P Peter Chen 提交者: Felipe Balbi

usb: udc: core: fix error handling

The udc device needs to be deleted if error occurs

Fixes: 855ed04a ("usb: gadget: udc-core: independent registration of
	gadgets and gadget drivers")
Signed-off-by: NPeter Chen <peter.chen@nxp.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 7442e6db
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册