提交 025a2233 编写于 作者: M Mukesh Ojha 提交者: Xie XiuQi

usb: u132-hcd: fix resource leak

[ Upstream commit f276e002 ]

if platform_driver_register fails, cleanup the allocated resource
gracefully.
Signed-off-by: NMukesh Ojha <mojha@codeaurora.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 45dbc822
...@@ -3202,6 +3202,9 @@ static int __init u132_hcd_init(void) ...@@ -3202,6 +3202,9 @@ static int __init u132_hcd_init(void)
printk(KERN_INFO "driver %s\n", hcd_name); printk(KERN_INFO "driver %s\n", hcd_name);
workqueue = create_singlethread_workqueue("u132"); workqueue = create_singlethread_workqueue("u132");
retval = platform_driver_register(&u132_platform_driver); retval = platform_driver_register(&u132_platform_driver);
if (retval)
destroy_workqueue(workqueue);
return retval; return retval;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册