From: Stephen Boyd <sboyd@kernel.org>
To: Binbin Zhou <zhoubb.aaron@gmail.com>,
Binbin Zhou <zhoubinbin@loongson.cn>,
Huacai Chen <chenhuacai@loongson.cn>,
Michael Turquette <mturquette@baylibre.com>,
Yinbo Zhu <zhuyinbo@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>,
linux-clk@vger.kernel.org, Xuerui Wang <kernel@xen0n.name>,
loongarch@lists.linux.dev, Binbin Zhou <zhoubinbin@loongson.cn>,
stable@vger.kernel.org,
Gustavo A . R . Silva <gustavoars@kernel.org>
Subject: Re: [PATCH v3 2/2] clk: clk-loongson2: Fix the number count of clk provider
Date: Tue, 14 Jan 2025 11:14:37 -0800 [thread overview]
Message-ID: <3043dcc07181dea905f97db93a9eb2eb.sboyd@kernel.org> (raw)
In-Reply-To: <82e43d89a9a6791129cf8ea14f4eeb666cd87be4.1736856470.git.zhoubinbin@loongson.cn>
Quoting Binbin Zhou (2025-01-14 05:00:29)
> Since commit 02fb4f008433 ("clk: clk-loongson2: Fix potential buffer
> overflow in flexible-array member access"), the clk provider register is
> failed.
>
> The count of `clks_num` is shown below:
>
> for (p = data; p->name; p++)
> clks_num++;
>
> In fact, `clks_num` represents the number of SoC clocks and should be
> expressed as the maximum value of the clock binding id in use (p->id + 1).
>
> Now we fix it to avoid the following error when trying to register a clk
> provider:
>
> [ 13.409595] of_clk_hw_onecell_get: invalid index 17
>
> Cc: stable@vger.kernel.org
> Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
> Fixes: 02fb4f008433 ("clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access")
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
Applied to clk-fixes
prev parent reply other threads:[~2025-01-14 19:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 13:00 [PATCH v3 0/2] clk: clk-loongson2: Fix two small issues Binbin Zhou
2025-01-14 13:00 ` [PATCH v3 1/2] clk: clk-loongson2: Switch to use devm_clk_hw_register_fixed_rate_parent_data() Binbin Zhou
2025-01-14 19:14 ` Stephen Boyd
2025-01-14 13:00 ` [PATCH v3 2/2] clk: clk-loongson2: Fix the number count of clk provider Binbin Zhou
2025-01-14 19:14 ` Stephen Boyd [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=3043dcc07181dea905f97db93a9eb2eb.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=gustavoars@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-clk@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=mturquette@baylibre.com \
--cc=stable@vger.kernel.org \
--cc=zhoubb.aaron@gmail.com \
--cc=zhoubinbin@loongson.cn \
--cc=zhuyinbo@loongson.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.