Commit 8293a624 authored by Mukesh Ojha's avatar Mukesh Ojha Committed by Greg Kroah-Hartman

usb: u132-hcd: fix resource leak

[ Upstream commit f276e002 ]

if platform_driver_register fails, cleanup the allocated resource
gracefully.
Signed-off-by: default avatarMukesh Ojha <mojha@codeaurora.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin (Microsoft) <sashal@kernel.org>
parent a3d1c9bc
......@@ -3208,6 +3208,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;
}
......
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