Skip to content

Commit f276e00

Browse files
Mukesh Ojhagregkh
authored andcommitted
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>
1 parent 93e1c8a commit f276e00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/usb/host/u132-hcd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,6 +3204,9 @@ static int __init u132_hcd_init(void)
32043204
printk(KERN_INFO "driver %s\n", hcd_name);
32053205
workqueue = create_singlethread_workqueue("u132");
32063206
retval = platform_driver_register(&u132_platform_driver);
3207+
if (retval)
3208+
destroy_workqueue(workqueue);
3209+
32073210
return retval;
32083211
}
32093212

0 commit comments

Comments
 (0)