usb: u132-hcd: fix resource leak
PATCH 1/1 usb: u132-hcd: fix resource leak
if platform_driver_register fails, cleanup the allocated resource gracefully.
Signed-off-by Mukesh Ojha <[email protected]>
---
This patch is dependent on "usb: u132-hcd: fix potential NULL pointer dereference" by Kangjie Lu, otherwise it may give merge conflict.
drivers/usb/host/u132-hcd.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/host/u132-hcd.c +3 -0
@@ -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; }