Commit 89dd0d8c authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

usb: udc: core: add device_del() call to error pathway

commit c93e64e9 upstream.

This patch fixes a bug in the error pathway of
usb_add_gadget_udc_release() in udc-core.c.  If the udc registration
fails, the gadget registration is not fully undone; there's a
put_device(&gadget->dev) call but no device_del().
Acked-by: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b5c270ed
......@@ -321,6 +321,7 @@ int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
err3:
put_device(&udc->dev);
device_del(&gadget->dev);
err2:
put_device(&gadget->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment