mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 08:09:56 +00:00
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>
This commit is contained in:
parent
93e1c8a638
commit
f276e00279
@ -3204,6 +3204,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user