[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1553587942-14037-1-git-send-email-mojha@codeaurora.org>
Date: Tue, 26 Mar 2019 13:42:22 +0530
From: Mukesh Ojha <mojha@...eaurora.org>
To: kjlu@....edu, pakki001@....edu, gregkh@...uxfoundation.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
colin.king@...onical.com
Cc: Mukesh Ojha <mojha@...eaurora.org>
Subject: [PATCH] usb: u132-hcd: fix resource leak
if platform_driver_register fails, cleanup the allocated resource
gracefully.
Signed-off-by: Mukesh Ojha <mojha@...eaurora.org>
---
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(+)
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 934584f..1d8d578 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -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;
}
--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Powered by blists - more mailing lists