summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2015-01-16 11:32:51 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-16 20:52:12 -0700
commit89dd0d8ca5069df6d18493a852285cc2dfb3bdfe (patch)
treedcb1fae474b5af0c3512b8b0157ce3865e0b89e8 /drivers/usb
parentb5c270edd80f00434b8b15ae12e9ecbd5c038b2a (diff)
usb: udc: core: add device_del() call to error pathway
commit c93e64e91248becd0edb8f01723dff9da890e2ab 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: Peter Chen <peter.chen@freescale.com> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/udc-core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c
index d69c35558f68..7d69931cf45d 100644
--- a/drivers/usb/gadget/udc/udc-core.c
+++ b/drivers/usb/gadget/udc/udc-core.c
@@ -321,6 +321,7 @@ err4:
err3:
put_device(&udc->dev);
+ device_del(&gadget->dev);
err2:
put_device(&gadget->dev);