All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
@ 2025-12-11 11:49 Amitai Gottlieb
  2025-12-11 12:17 ` Cristian Marussi
  0 siblings, 1 reply; 7+ messages in thread
From: Amitai Gottlieb @ 2025-12-11 11:49 UTC (permalink / raw)
  To: arm-scmi; +Cc: Amitai Gottlieb

In function `scmi_devm_notifier_unregister` the notifier-block parameter
was unused and therefore never passed to `devres_release`. This causes
the function to always return -ENOENT and fail to unregister the
notifier.

In drivers that rely on this function for cleanup this causes
unexpected failures including kernel-panic.

Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres
notification ops")
Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
---

This is not needed upstream becaues the bug was fixed
in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
6.6 kernels.

 drivers/firmware/arm_scmi/notify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
index 0efd20cd9d69..4782b115e6ec 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -1539,6 +1539,7 @@ static int scmi_devm_notifier_unregister(struct scmi_device *sdev,
 	dres.handle = sdev->handle;
 	dres.proto_id = proto_id;
 	dres.evt_id = evt_id;
+	dres.nb = nb;
 	if (src_id) {
 		dres.__src_id = *src_id;
 		dres.src_id = &dres.__src_id;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister
@ 2025-12-15 16:37 Amitai Gottlieb
  2025-12-15 17:13 ` Sudeep Holla
  0 siblings, 1 reply; 7+ messages in thread
From: Amitai Gottlieb @ 2025-12-15 16:37 UTC (permalink / raw)
  To: stable
  Cc: sudeep.holla, amitaigottlieb, Amitai Gottlieb, Dan Carpenter,
	Cristian Marussi

In function `scmi_devm_notifier_unregister` the notifier-block parameter
was unused and therefore never passed to `devres_release`. This causes
the function to always return -ENOENT and fail to unregister the
notifier.

In drivers that rely on this function for cleanup this causes
unexpected failures including kernel-panic.

This is not needed upstream becaues the bug was fixed
in a refactor by commit 264a2c520628 ("firmware: arm_scmi: Simplify
scmi_devm_notifier_unregister").  It is needed for the 5.15, 6.1 and
6.6 kernels.

Cc: <stable@vger.kernel.org> # 5.15.x, 6.1.x, and 6.6.x
Fixes: 5ad3d1cf7d34 ("firmware: arm_scmi: Introduce new devres notification ops")
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Amitai Gottlieb <amitaig@hailo.ai>
---

 drivers/firmware/arm_scmi/notify.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
index 0efd20cd9d69..4782b115e6ec 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -1539,6 +1539,7 @@ static int scmi_devm_notifier_unregister(struct scmi_device *sdev,
 	dres.handle = sdev->handle;
 	dres.proto_id = proto_id;
 	dres.evt_id = evt_id;
+	dres.nb = nb;
 	if (src_id) {
 		dres.__src_id = *src_id;
 		dres.src_id = &dres.__src_id;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-12-15 17:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11 11:49 [PATCH] firmware: arm_scmi: Fix unused notifier-block in unregister Amitai Gottlieb
2025-12-11 12:17 ` Cristian Marussi
2025-12-11 12:53   ` Dan Carpenter
     [not found]     ` <DB9P194MB13560B1BBAD2A8A8E6260719C1ADA@DB9P194MB1356.EURP194.PROD.OUTLOOK.COM>
2025-12-15 12:19       ` Fw: " amitaigottlieb
2025-12-15 15:13         ` Sudeep Holla
  -- strict thread matches above, loose matches on Subject: below --
2025-12-15 16:37 Amitai Gottlieb
2025-12-15 17:13 ` Sudeep Holla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.