From: Qinglang Miao <miaoqinglang@huawei.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Qinglang Miao <miaoqinglang@huawei.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] firmware: arm_scmi: fix missing destroy_workqueue() on error in scmi_notification_init
Date: Mon, 9 Nov 2020 17:15:17 +0800 [thread overview]
Message-ID: <20201109091517.55895-1-miaoqinglang@huawei.com> (raw)
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@huawei.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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-11-09 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 9:15 Qinglang Miao [this message]
2020-11-09 17:51 ` [PATCH] firmware: arm_scmi: fix missing destroy_workqueue() on error in scmi_notification_init Cristian Marussi
2020-11-10 1:23 ` Qinglang Miao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201109091517.55895-1-miaoqinglang@huawei.com \
--to=miaoqinglang@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.holla@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox