* [PATCH] powercap: arm_scmi: Fix potential stale zones after a skipped leaf
@ 2026-11-13 14:09 Guangshuo Li
2026-11-13 16:03 ` Cristian Marussi
0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-11-13 14:09 UTC (permalink / raw)
To: Sudeep Holla, Cristian Marussi, Rafael J. Wysocki
Cc: arm-scmi, linux-arm-kernel, linux-pm, linux-kernel, stable
scmi_zones_register() skips leaf zones that cannot be registered, but
returns the last leaf error when that leaf ends the traversal. Probe
then fails without unregistering the successfully registered zones,
whose private data is device-managed.
Return success after completing the traversal. Keep the existing error
return and full rollback for a failed non-leaf zone.
This issue was found by our static analysis tool under development.
Fixes: 3e767d6850f8 ("powercap: arm_scmi: Remove recursion while parsing zones")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
---
drivers/powercap/arm_scmi_powercap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c
index ab66e9a3b1e2..edc1e2823ec3 100644
--- a/drivers/powercap/arm_scmi_powercap.c
+++ b/drivers/powercap/arm_scmi_powercap.c
@@ -407,6 +407,7 @@ static int scmi_zones_register(struct device *dev,
node);
}
}
+ ret = 0;
out:
kfree(zones_stack);
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] powercap: arm_scmi: Fix potential stale zones after a skipped leaf
2026-11-13 14:09 [PATCH] powercap: arm_scmi: Fix potential stale zones after a skipped leaf Guangshuo Li
@ 2026-11-13 16:03 ` Cristian Marussi
0 siblings, 0 replies; 2+ messages in thread
From: Cristian Marussi @ 2026-11-13 16:03 UTC (permalink / raw)
To: Guangshuo Li
Cc: Sudeep Holla, Cristian Marussi, Rafael J. Wysocki, arm-scmi,
linux-arm-kernel, linux-pm, linux-kernel, stable
On Fri, Nov 13, 2026 at 10:09:35PM +0800, Guangshuo Li wrote:
> scmi_zones_register() skips leaf zones that cannot be registered, but
> returns the last leaf error when that leaf ends the traversal. Probe
> then fails without unregistering the successfully registered zones,
> whose private data is device-managed.
LGTM.
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Thanks,
Cristian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-13 16:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 14:09 [PATCH] powercap: arm_scmi: Fix potential stale zones after a skipped leaf Guangshuo Li
2026-11-13 16:03 ` Cristian Marussi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®