diff options
| author | Binbin Zhou <[email protected]> | 2025-01-14 13:00:29 +0000 |
|---|---|---|
| committer | Stephen Boyd <[email protected]> | 2025-01-14 19:14:33 +0000 |
| commit | 5fb33b6797633ce60908d13dc06c54a101621845 (patch) | |
| tree | 4072d30a1e30c27b0d464fa418d0124f4fcebe80 /net/unix/unix_bpf.c | |
| parent | Merge tag 'sunxi-clk-fixes-for-6.13' of https://git.kernel.org/pub/scm/linux/... (diff) | |
| download | kernel-5fb33b6797633ce60908d13dc06c54a101621845.tar.gz kernel-5fb33b6797633ce60908d13dc06c54a101621845.zip | |
clk: clk-loongson2: Fix the number count of clk provider
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: [email protected]
Cc: Gustavo A. R. Silva <[email protected]>
Fixes: 02fb4f008433 ("clk: clk-loongson2: Fix potential buffer overflow in flexible-array member access")
Signed-off-by: Binbin Zhou <[email protected]>
Link: https://lore.kernel.org/r/82e43d89a9a6791129cf8ea14f4eeb666cd87be4.1736856470.git.zhoubinbin@loongson.cn
Signed-off-by: Stephen Boyd <[email protected]>
Diffstat (limited to 'net/unix/unix_bpf.c')
0 files changed, 0 insertions, 0 deletions
