]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: en7523: Initialize num before accessing hws in en7523_register_clocks()
authorHaoyu Li <lihaoyu499@gmail.com>
Tue, 3 Dec 2024 14:29:15 +0000 (22:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:04:13 +0000 (20:04 +0100)
commit07bc1978d59bfb571d3d0e2c8dd0d5dbfd48062d
treef4aabc59d8cc31667c3d255502c8a53c6fa2acf4
parent650214c925e8a90b6c03b3d37eff01ad06f83169
clk: en7523: Initialize num before accessing hws in en7523_register_clocks()

[ Upstream commit 52fd1709e41d3a85b48bcfe2404a024ebaf30c3b ]

With the new __counted_by annotation in clk_hw_onecell_data, the "num"
struct member must be set before accessing the "hws" array. Failing to
do so will trigger a runtime warning when enabling CONFIG_UBSAN_BOUNDS
and CONFIG_FORTIFY_SOURCE.

Fixes: f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with __counted_by")
Signed-off-by: Haoyu Li <lihaoyu499@gmail.com>
Link: https://lore.kernel.org/r/20241203142915.345523-1-lihaoyu499@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk-en7523.c