lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201109091517.55895-1-miaoqinglang@huawei.com>
Date:   Mon, 9 Nov 2020 17:15:17 +0800
From:   Qinglang Miao <miaoqinglang@...wei.com>
To:     Sudeep Holla <sudeep.holla@....com>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>,
        Qinglang Miao <miaoqinglang@...wei.com>
Subject: [PATCH] firmware: arm_scmi: fix missing destroy_workqueue() on error in scmi_notification_init

Add the missing destroy_workqueue() before return from
scmi_notification_init in the error handling case when
fails to do devm_kcalloc().

Fixes: bd31b249692e ("firmware: arm_scmi: Add notification dispatch and delivery")
Signed-off-by: Qinglang Miao <miaoqinglang@...wei.com>
---
 drivers/firmware/arm_scmi/notify.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
index 2754f9d01636..3048e57d9731 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -1476,8 +1476,10 @@ int scmi_notification_init(struct scmi_handle *handle)
 
 	ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO,
 						sizeof(char *), GFP_KERNEL);
-	if (!ni->registered_protocols)
+	if (!ni->registered_protocols) {
+		destroy_workqueue(ni->notify_wq);
 		goto err;
+	}
 
 	mutex_init(&ni->pending_mtx);
 	hash_init(ni->pending_events_handlers);
-- 
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ