From: sashiko-bot@kernel.org
To: "Shawn Guo" <shengchao.guo@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/4] pmdomain: qcom: rpmhpd: Add NMXC power domain for Nord
Date: Wed, 26 Aug 2026 10:38:51 +0000 [thread overview]
Message-ID: <20260826103852.1BC8A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260826102746.633076-3-shengchao.guo@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing cleanup of previously initialized genpds on error paths in rpmhpd_probe() leading to Use-After-Free list corruption.
--
commit fffeb8f7d724849238dff1efcb31a1c3a8c540a4
Author: Anurag Pateriya <anurag.pateriya@oss.qualcomm.com>
pmdomain: qcom: rpmhpd: Add NMXC power domain for Nord
Add the nmxc.lvl RPMh resource and register it in the Nord power domain
table. Nord supplies the NSP memory rail from this dedicated resource
rather than from the shared MX rail, so consumers need it exposed as its
own power domain.
> diff --git a/drivers/pmdomain/qcom/rpmhpd.c b/drivers/pmdomain/qcom/rpmhpd.c
> index 90743275942db..28cc8825eee45 100644
> --- a/drivers/pmdomain/qcom/rpmhpd.c
> +++ b/drivers/pmdomain/qcom/rpmhpd.c
> @@ -198,6 +198,11 @@ static struct rpmhpd mxc_ao = {
> .res_name = "mxc.lvl",
> };
>
> +static struct rpmhpd nmxc = {
> + .pd = { .name = "nmxc", },
> + .res_name = "nmxc.lvl",
> +};
> +
> static struct rpmhpd nsp = {
> .pd = { .name = "nsp", },
> .res_name = "nsp.lvl",
> @@ -327,6 +332,7 @@ static struct rpmhpd *nord_rpmhpds[] = {
> [RPMHPD_MX_AO] = &mx_ao,
> [RPMHPD_MXC] = &mxc,
> [RPMHPD_MXC_AO] = &mxc_ao,
> + [RPMHPD_NMXC] = &nmxc,
[Severity: High]
This is a pre-existing issue, but I noticed a potential use-after-free issue
in the error paths of rpmhpd_probe() when adding new power domains.
If rpmhpd_probe() fails midway during its initialization loop:
rpmhpd_probe() {
for (i = 0; i < num_pds; i++) {
...
ret = rpmhpd_update_level_mapping(rpmhpds[i]);
if (ret)
return ret;
...
pm_genpd_init(&rpmhpds[i]->pd, NULL, true);
...
}
}
Or if it fails at the very end when registering the provider:
return of_genpd_add_provider_onecell(pdev->dev.of_node, data);
The function directly returns an error without calling pm_genpd_remove() for
the previously initialized domains. Because pm_genpd_init() links the
statically allocated domain structures into the global genpd list, does this
leave dangling pointers?
Since this driver can be built as a module, if the module is unloaded after a
probe failure, its data section is freed. Could this result in the global
list pointing to freed memory, causing a crash the next time the list is
traversed?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260826102746.633076-1-shengchao.guo@oss.qualcomm.com?part=2
next prev parent reply other threads:[~2026-08-26 10:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 10:27 [PATCH 0/4] Switch Nord CDSPs onto NMXC power domain Shawn Guo
2026-08-26 10:27 ` [PATCH 1/4] dt-bindings: power: qcom,rpmhpd: Add NMXC power domain index Shawn Guo
2026-08-26 10:27 ` [PATCH 2/4] pmdomain: qcom: rpmhpd: Add NMXC power domain for Nord Shawn Guo
2026-08-26 10:38 ` sashiko-bot [this message]
2026-08-26 11:05 ` Abel Vesa
2026-08-26 13:04 ` Konrad Dybcio
2026-08-26 13:14 ` Shawn Guo
2026-08-26 13:17 ` Konrad Dybcio
2026-08-26 10:27 ` [PATCH 3/4] dt-bindings: remoteproc: qcom,nord-pas: Switch CDSPs to NMXC rail Shawn Guo
2026-08-26 12:52 ` Konrad Dybcio
2026-08-26 13:31 ` Shawn Guo
2026-08-26 10:27 ` [PATCH 4/4] remoteproc: qcom: pas: Switch Nord CDSPs from MX to NMXC Shawn Guo
2026-08-26 11:06 ` Abel Vesa
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=20260826103852.1BC8A1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shengchao.guo@oss.qualcomm.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