diff options
| author | Binbin Zhou <zhoubinbin@loongson.cn> | 2025-01-14 21:00:29 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-17 10:05:10 +0100 |
| commit | ea3f6ef7720bf3e3b9433ea299a9bb8944221df0 (patch) | |
| tree | 1b9962a95b2bd57e02b6583a3d2ca9288ef4fcc2 /scripts/stackusage | |
| parent | 15413c1a65513fbc52502ff714d31b416e6cdeed (diff) | |
| download | linux-ea3f6ef7720bf3e3b9433ea299a9bb8944221df0.tar.gz linux-ea3f6ef7720bf3e3b9433ea299a9bb8944221df0.tar.bz2 linux-ea3f6ef7720bf3e3b9433ea299a9bb8944221df0.zip | |
clk: clk-loongson2: Fix the number count of clk provider
commit 5fb33b6797633ce60908d13dc06c54a101621845 upstream.
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>
Link: https://lore.kernel.org/r/82e43d89a9a6791129cf8ea14f4eeb666cd87be4.1736856470.git.zhoubinbin@loongson.cn
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions
