Skip to content

Commit

Permalink
usb: udc: core: add device_del() call to error pathway
Browse files Browse the repository at this point in the history
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().

CC: <stable@vger.kernel.org>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Alan Stern authored and Felipe Balbi committed Aug 3, 2015
1 parent 4248bd7 commit c93e64e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/udc/udc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,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);
Expand Down

0 comments on commit c93e64e

Please sign in to comment.