usb: u132-hcd: fix resource leak
[ Upstream commit f276e002793cdb820862e8ea8f76769d56bba575 ] 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> Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
This commit is contained in:
parent
b90577cedf
commit
098420fc84
|
@ -3214,6 +3214,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user