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;
Add [STABLE ONLY] in the subject please along with [PATCH] and repost it.
Also add Greg Kroah-Hartman gregkh@linuxfoundation.org to cc as well.
On Mon, Dec 15, 2025 at 06:37:32PM +0200, Amitai Gottlieb wrote:
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.
I would slightly reword the commit message like below.
| In scmi_devm_notifier_unregister(), the notifier-block argument was ignored | and never passed to devres_release(). As a result, the function always | returned -ENOENT and failed to unregister the notifier. | | Drivers that depend on this helper for teardown could therefore hit | unexpected failures, including kernel panics. | | Commit 264a2c520628 ("firmware: arm_scmi: Simplify scmi_devm_notifier_unregister") | removed the faulty code path during refactoring and hence this fix is not | required upstream.
(add a panic log if you have seen one, that would help)
With that you can add,
Reviewed-by: Sudeep Holla sudeep.holla@arm.com
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
linux-stable-mirror@lists.linaro.org