summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMukesh Ojha <mojha@codeaurora.org>2019-03-26 13:42:22 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-28 00:08:49 +0900
commitf276e002793cdb820862e8ea8f76769d56bba575 (patch)
tree6d2a11bab1191dbb7b0e7216d173d5ed8b27c828 /drivers
parent93e1c8a638308980309e009cc40b5a57ef87caf1 (diff)
usb: u132-hcd: fix resource leak
if platform_driver_register fails, cleanup the allocated resource gracefully. Signed-off-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/u132-hcd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 934584f0a20a..6343fbacd244 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -3204,6 +3204,9 @@ static int __init u132_hcd_init(void)
printk(KERN_INFO "driver %s\n", hcd_name);
workqueue = create_singlethread_workqueue("u132");
retval = platform_driver_register(&u132_platform_driver);
+ if (retval)
+ destroy_workqueue(workqueue);
+
return retval;
}