From fcd74898a4eeca688c9d9d77a7fec705884cc1e5 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 21 Aug 2026 10:53:48 +0200 Subject: [PATCH] clk: uniphier: Make sure clk_init_data is fully initialized The clk_init_data structure contains several mutually-exclusive members for different methods to specify the possible parents of a clock, prompting drivers to initialize only the members they need. However, not initializing all members may cause subtle issues, which are only exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is enabled. Make sure all members are fully initialized, to avoid such bugs, and to prevent future breakage when converting drivers to a different method for specifying the parents. Signed-off-by: Geert Uytterhoeven Message-ID: <491e41d759cec667d6bcd742673e1fec70b4bc31.1787239813.git.geert+renesas@glider.be> Signed-off-by: Brian Masney --- drivers/clk/uniphier/clk-uniphier-cpugear.c | 2 +- drivers/clk/uniphier/clk-uniphier-fixed-factor.c | 2 +- drivers/clk/uniphier/clk-uniphier-fixed-rate.c | 2 +- drivers/clk/uniphier/clk-uniphier-gate.c | 2 +- drivers/clk/uniphier/clk-uniphier-mux.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/uniphier/clk-uniphier-cpugear.c b/drivers/clk/uniphier/clk-uniphier-cpugear.c index a2f01a4da127..165c6832b722 100644 --- a/drivers/clk/uniphier/clk-uniphier-cpugear.c +++ b/drivers/clk/uniphier/clk-uniphier-cpugear.c @@ -79,7 +79,7 @@ struct clk_hw *uniphier_clk_register_cpugear(struct device *dev, const struct uniphier_clk_cpugear_data *data) { struct uniphier_clk_cpugear *gear; - struct clk_init_data init; + struct clk_init_data init = {}; int ret; gear = devm_kzalloc(dev, sizeof(*gear), GFP_KERNEL); diff --git a/drivers/clk/uniphier/clk-uniphier-fixed-factor.c b/drivers/clk/uniphier/clk-uniphier-fixed-factor.c index a6a37a6bca3a..c86683fce205 100644 --- a/drivers/clk/uniphier/clk-uniphier-fixed-factor.c +++ b/drivers/clk/uniphier/clk-uniphier-fixed-factor.c @@ -13,8 +13,8 @@ struct clk_hw *uniphier_clk_register_fixed_factor(struct device *dev, const char *name, const struct uniphier_clk_fixed_factor_data *data) { + struct clk_init_data init = {}; struct clk_fixed_factor *fix; - struct clk_init_data init; int ret; fix = devm_kzalloc(dev, sizeof(*fix), GFP_KERNEL); diff --git a/drivers/clk/uniphier/clk-uniphier-fixed-rate.c b/drivers/clk/uniphier/clk-uniphier-fixed-rate.c index 3bc55ab75314..63f49d3bab80 100644 --- a/drivers/clk/uniphier/clk-uniphier-fixed-rate.c +++ b/drivers/clk/uniphier/clk-uniphier-fixed-rate.c @@ -13,8 +13,8 @@ struct clk_hw *uniphier_clk_register_fixed_rate(struct device *dev, const char *name, const struct uniphier_clk_fixed_rate_data *data) { + struct clk_init_data init = {}; struct clk_fixed_rate *fixed; - struct clk_init_data init; int ret; /* allocate fixed-rate clock */ diff --git a/drivers/clk/uniphier/clk-uniphier-gate.c b/drivers/clk/uniphier/clk-uniphier-gate.c index e58093e79dd7..9f49e6bb6b20 100644 --- a/drivers/clk/uniphier/clk-uniphier-gate.c +++ b/drivers/clk/uniphier/clk-uniphier-gate.c @@ -61,8 +61,8 @@ struct clk_hw *uniphier_clk_register_gate(struct device *dev, const char *name, const struct uniphier_clk_gate_data *data) { + struct clk_init_data init = {}; struct uniphier_clk_gate *gate; - struct clk_init_data init; int ret; gate = devm_kzalloc(dev, sizeof(*gate), GFP_KERNEL); diff --git a/drivers/clk/uniphier/clk-uniphier-mux.c b/drivers/clk/uniphier/clk-uniphier-mux.c index 1998e9d4cfc0..a63ad4df8e65 100644 --- a/drivers/clk/uniphier/clk-uniphier-mux.c +++ b/drivers/clk/uniphier/clk-uniphier-mux.c @@ -58,8 +58,8 @@ struct clk_hw *uniphier_clk_register_mux(struct device *dev, const char *name, const struct uniphier_clk_mux_data *data) { + struct clk_init_data init = {}; struct uniphier_clk_mux *mux; - struct clk_init_data init; int ret; mux = devm_kzalloc(dev, sizeof(*mux), GFP_KERNEL);