[PATCH net-next v2 3/3] net: phy: air_en8811h: Make sure clk_init_data is fully initialized
Geert Uytterhoeven
geert+renesas at glider.be
Thu Sep 3 02:00:41 PDT 2026
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 <geert+renesas at glider.be>
Reviewed-by: Brian Masney <bmasney at redhat.com>
---
Compile-tested only.
v2:
- Add Reviewed-by.
---
drivers/net/phy/air_en8811h.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
index 0eeb7b9a4e260bcb..429231949120c7c8 100644
--- a/drivers/net/phy/air_en8811h.c
+++ b/drivers/net/phy/air_en8811h.c
@@ -932,7 +932,7 @@ static const struct clk_ops an8811hb_clk_ops = {
static int an8811hb_clk_provider_setup(struct device *dev, struct clk_hw *hw)
{
- struct clk_init_data init;
+ struct clk_init_data init = {};
int ret;
if (!IS_ENABLED(CONFIG_COMMON_CLK))
@@ -1031,7 +1031,7 @@ static const struct clk_ops en8811h_clk_ops = {
static int en8811h_clk_provider_setup(struct device *dev, struct clk_hw *hw)
{
- struct clk_init_data init;
+ struct clk_init_data init = {};
int ret;
if (!IS_ENABLED(CONFIG_COMMON_CLK))
--
2.43.0
More information about the linux-arm-kernel
mailing list