From: Mukesh Ojha Date: Tue, 26 Mar 2019 08:12:22 +0000 (+0530) Subject: usb: u132-hcd: fix resource leak X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f276e002793cdb820862e8ea8f76769d56bba575;p=openwrt%2Fstaging%2Fblogic.git usb: u132-hcd: fix resource leak if platform_driver_register fails, cleanup the allocated resource gracefully. Signed-off-by: Mukesh Ojha Signed-off-by: Greg Kroah-Hartman --- 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; }