]> Git Repo - linux.git/commitdiff
usb: u132-hcd: fix resource leak
authorMukesh Ojha <[email protected]>
Tue, 26 Mar 2019 08:12:22 +0000 (13:42 +0530)
committerGreg Kroah-Hartman <[email protected]>
Wed, 27 Mar 2019 15:08:49 +0000 (00:08 +0900)
if platform_driver_register fails, cleanup the allocated resource
gracefully.

Signed-off-by: Mukesh Ojha <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/usb/host/u132-hcd.c

index 934584f0a20a7bee30adcee141c0a7eb63a51b3f..6343fbacd2442adea634a9911bed82cf1603c417 100644 (file)
@@ -3204,6 +3204,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;
 }
 
This page took 0.06542 seconds and 4 git commands to generate.