Skip to content

Commit 21fe517

Browse files
masneybgregkh
authored andcommitted
clk: visconti: pll: initialize clk_init_data to zero
[ Upstream commit 1603cbb ] Sashiko reported the following: > The struct clk_init_data init is declared on the stack without being > fully zero-initialized. While fields like name, flags, parent_names, > num_parents, and ops are explicitly assigned, the parent_data and > parent_hws fields are left containing stack garbage. clk_core_populate_parent_map() currently prefers the parent names over the parent data and hws, so this isn't a problem at the moment. If that ordering ever changed in the future, then this could lead to some unexpected crashes. Let's just go ahead and make sure that the struct clk_init_data is initialized to zero as a good practice. Fixes: b4cbe60 ("clk: visconti: Add support common clock driver and reset driver") Link: https://sashiko.dev/#/patchset/20260326042317.122536-1-rosenp%40gmail.com Signed-off-by: Brian Masney <bmasney@redhat.com> Reviewed-by: Benoît Monin <benoit.monin@bootlin.com> Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent caa74d8 commit 21fe517

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/clk/visconti

drivers/clk/visconti/pll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static struct clk_hw *visconti_register_pll(struct visconti_pll_provider *ctx,
244244
const struct visconti_pll_rate_table *rate_table,
245245
spinlock_t *lock)
246246
{
247-
struct clk_init_data init;
247+
struct clk_init_data init = {};
248248
struct visconti_pll *pll;
249249
struct clk_hw *pll_hw_clk;
250250
size_t len;

0 commit comments

Comments
 (0)