From: "zhangzekun (A)" <zhangzekun11@huawei.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: <andersson@kernel.org>, <konradybcio@kernel.org>,
<ulf.hansson@linaro.org>, <linux-pm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH] pmdomain: qcom: cpr: Fix possible uninitialized value
Date: Mon, 30 Sep 2024 17:53:42 +0800 [thread overview]
Message-ID: <6436838e-8b2d-4727-b207-e6c3168960e5@huawei.com> (raw)
In-Reply-To: <20240930094456.2593136-1-ruanjinjie@huawei.com>
Hi, Jinjie
I have sent a patch with the same modification before:
https://lore.kernel.org/linux-pm/20240926134211.45394-1-zhangzekun11@huawei.com/
Best Regards,
Zekun
在 2024/9/30 17:44, Jinjie Ruan 写道:
> of_property_read_u64() can fail and left "rate" uninitialized,
> and the zero check in cpr_corner_init() for cpr_get_opp_hz_for_req()
> can not prevent it and it will assign cdata[level - 1].freq to random
> value, so init it to fix it.
>
> Cc: stable@vger.kernel.org # v6.12
> Fixes: 181c8148556a ("pmdomain: qcom-cpr: Use scope based of_node_put() to simplify code.")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> drivers/pmdomain/qcom/cpr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/qcom/cpr.c b/drivers/pmdomain/qcom/cpr.c
> index e1fca65b80be..26a60a101e42 100644
> --- a/drivers/pmdomain/qcom/cpr.c
> +++ b/drivers/pmdomain/qcom/cpr.c
> @@ -1052,7 +1052,7 @@ static unsigned long cpr_get_opp_hz_for_req(struct dev_pm_opp *ref,
> of_parse_phandle(child_np, "required-opps", 0);
>
> if (child_req_np == ref_np) {
> - u64 rate;
> + u64 rate = 0;
>
> of_property_read_u64(child_np, "opp-hz", &rate);
> return (unsigned long) rate;
prev parent reply other threads:[~2024-09-30 9:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 9:44 Jinjie Ruan
2024-09-30 9:53 ` zhangzekun (A) [this message]
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=6436838e-8b2d-4727-b207-e6c3168960e5@huawei.com \
--to=zhangzekun11@huawei.com \
--cc=andersson@kernel.org \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=ruanjinjie@huawei.com \
--cc=ulf.hansson@linaro.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®