* [PATCH] clk: visconti: pll: initialize clk_init_data to zero
@ 2026-03-30 14:32 Brian Masney
2026-04-01 12:30 ` Benoît Monin
0 siblings, 1 reply; 3+ messages in thread
From: Brian Masney @ 2026-03-30 14:32 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu, Rosen Penev
Cc: linux-clk, linux-arm-kernel, linux-kernel, Brian Masney
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: b4cbe606dc367 ("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>
---
drivers/clk/visconti/pll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/visconti/pll.c b/drivers/clk/visconti/pll.c
index 6fd02c4b641ed58f1943e55dd60ae80aba30b902..805b95481281761ad7ea4f59ddac07e4cdfb9d42 100644
--- a/drivers/clk/visconti/pll.c
+++ b/drivers/clk/visconti/pll.c
@@ -249,7 +249,7 @@ static struct clk_hw *visconti_register_pll(struct visconti_pll_provider *ctx,
const struct visconti_pll_rate_table *rate_table,
spinlock_t *lock)
{
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct visconti_pll *pll;
struct clk_hw *pll_hw_clk;
size_t len;
---
base-commit: 3b058d1aeeeff27a7289529c4944291613b364e9
change-id: 20260330-clk-visconti-init-58fae9a7e6a1
Best regards,
--
Brian Masney <bmasney@redhat.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: visconti: pll: initialize clk_init_data to zero
2026-03-30 14:32 [PATCH] clk: visconti: pll: initialize clk_init_data to zero Brian Masney
@ 2026-04-01 12:30 ` Benoît Monin
2026-04-02 4:22 ` nobuhiro.iwamatsu.x90
0 siblings, 1 reply; 3+ messages in thread
From: Benoît Monin @ 2026-04-01 12:30 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Nobuhiro Iwamatsu, Rosen Penev,
Brian Masney
Cc: linux-clk, linux-arm-kernel, linux-kernel
On Monday, 30 March 2026 at 16:32:37 CEST, Brian Masney wrote:
> 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: b4cbe606dc367 ("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>
Best regards,
--
Benoît Monin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] clk: visconti: pll: initialize clk_init_data to zero
2026-04-01 12:30 ` Benoît Monin
@ 2026-04-02 4:22 ` nobuhiro.iwamatsu.x90
0 siblings, 0 replies; 3+ messages in thread
From: nobuhiro.iwamatsu.x90 @ 2026-04-02 4:22 UTC (permalink / raw)
To: benoit.monin, mturquette, sboyd, rosenp, bmasney
Cc: linux-clk, linux-arm-kernel, linux-kernel
Hi,
> -----Original Message-----
> From: Benoît Monin <benoit.monin@bootlin.com>
> Sent: Wednesday, April 1, 2026 9:30 PM
> To: Michael Turquette <mturquette@baylibre.com>; Stephen Boyd <sboyd@kernel.org>; iwamatsu nobuhiro(岩松 信洋
> □DITC○CPT) <nobuhiro.iwamatsu.x90@mail.toshiba>; Rosen Penev <rosenp@gmail.com>; Brian Masney
> <bmasney@redhat.com>
> Cc: linux-clk@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] clk: visconti: pll: initialize clk_init_data to zero
>
> On Monday, 30 March 2026 at 16:32:37 CEST, Brian Masney wrote:
> > 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: b4cbe606dc367 ("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>
Best regards,
Nobuhiro
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-02 4:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 14:32 [PATCH] clk: visconti: pll: initialize clk_init_data to zero Brian Masney
2026-04-01 12:30 ` Benoît Monin
2026-04-02 4:22 ` nobuhiro.iwamatsu.x90
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox