Skip to content

Commit a83b227

Browse files
bastien-curutchetbebarino
authored andcommitted
clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use
The flag attribute of the struct clk_init_data isn't initialized before the devm_clk_hw_register() call. This can lead to unexpected behavior during registration. Initialize the entire clk_init_data to zero at declaration. Cc: [email protected] Fixes: 58e1e2d ("clk: davinci: cfgchip: Add TI DA8XX USB PHY clocks") Signed-off-by: Bastien Curutchet <[email protected]> Reviewed-by: David Lechner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 589eb11 commit a83b227

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/davinci/da8xx-cfgchip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ da8xx_cfgchip_register_usb0_clk48(struct device *dev,
508508
const char * const parent_names[] = { "usb_refclkin", "pll0_auxclk" };
509509
struct clk *fck_clk;
510510
struct da8xx_usb0_clk48 *usb0;
511-
struct clk_init_data init;
511+
struct clk_init_data init = {};
512512
int ret;
513513

514514
fck_clk = devm_clk_get(dev, "fck");
@@ -583,7 +583,7 @@ da8xx_cfgchip_register_usb1_clk48(struct device *dev,
583583
{
584584
const char * const parent_names[] = { "usb0_clk48", "usb_refclkin" };
585585
struct da8xx_usb1_clk48 *usb1;
586-
struct clk_init_data init;
586+
struct clk_init_data init = {};
587587
int ret;
588588

589589
usb1 = devm_kzalloc(dev, sizeof(*usb1), GFP_KERNEL);

0 commit comments

Comments
 (0)