From: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
To: Sudeep Holla <sudeep.holla@kernel.org>,
Cristian Marussi <cristian.marussi@arm.com>,
"Rafael J. Wysocki" <rafael@kernel.org>
Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: [PATCH] powercap: arm_scmi: Fix potential stale zones after a skipped leaf
Date: Fri, 13 Nov 2026 22:09:35 +0800 [thread overview]
Message-ID: <20261113-4e14e563a1-powercap-scmi@mail.sdu.edu.cn> (raw)
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
next reply other threads:[~2026-11-13 14:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 14:09 Guangshuo Li [this message]
2026-11-13 16:03 ` Cristian Marussi
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=20261113-4e14e563a1-powercap-scmi@mail.sdu.edu.cn \
--to=liguangshuo@mail.sdu.edu.cn \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=sudeep.holla@kernel.org \
/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
all inboxes | Powered by JetHome®