Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: mediatek: Initialize clk_init_data

The variable init (struct clk_init_data) is allocated on the stack.
We weren't initializing the .flags field, so it contains random junk,
which can cause all kinds of interesting issues when the flags are
parsed by clk_register.

Signed-off-by: Ricky Liang <jcliang@chromium.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Ricky Liang and committed by
Stephen Boyd
95f58981 df5338d9

+2 -2
+1 -1
drivers/clk/mediatek/clk-gate.c
··· 109 109 { 110 110 struct mtk_clk_gate *cg; 111 111 struct clk *clk; 112 - struct clk_init_data init; 112 + struct clk_init_data init = {}; 113 113 114 114 cg = kzalloc(sizeof(*cg), GFP_KERNEL); 115 115 if (!cg)
+1 -1
drivers/clk/mediatek/clk-pll.c
··· 268 268 void __iomem *base) 269 269 { 270 270 struct mtk_clk_pll *pll; 271 - struct clk_init_data init; 271 + struct clk_init_data init = {}; 272 272 struct clk *clk; 273 273 const char *parent_name = "clk26m"; 274 274