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@glider.be>
---
Compile-tested only.
---
drivers/clk/clk-stm32f4.c | 4 ++--
drivers/clk/clk-stm32h7.c | 2 +-
drivers/clk/stm32/clk-stm32mp1.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
@@ -485,8 +485,8 @@ static struct clk *clk_register_apb_mul(struct device *dev, const char *name,
const char *parent_name,
unsigned long flags, u8 bit_idx)
{
+ struct clk_init_data init = {};
struct clk_apb_mul *am;
- struct clk_init_data init;
struct clk *clk;
am = kzalloc_obj(*am);
@@ -810,8 +810,8 @@ static struct clk_hw *clk_register_pll_div(const char *name,
struct clk_hw *pll_hw, spinlock_t *lock)
{
struct stm32f4_pll_div *pll_div;
+ struct clk_init_data init = {};
struct clk_hw *hw;
- struct clk_init_data init;
int ret;
/* allocate the divider */
@@ -462,8 +462,8 @@ static struct clk_hw *clk_register_stm32_timer_ker(struct device *dev,
u8 dppre_shift,
spinlock_t *lock)
{
+ struct clk_init_data init = {};
struct timer_ker *element;
- struct clk_init_data init;
struct clk_hw *hw;
int err;
@@ -902,8 +902,8 @@ static struct clk_hw *clk_register_pll(struct device *dev, const char *name,
unsigned long flags,
spinlock_t *lock)
{
+ struct clk_init_data init = {};
struct stm32_pll_obj *element;
- struct clk_init_data init;
struct clk_hw *hw;
int err;
@@ -1041,8 +1041,8 @@ static struct clk_hw *clk_register_cktim(struct device *dev, const char *name,
void __iomem *timpre,
spinlock_t *lock)
{
+ struct clk_init_data init = {};
struct timer_cker *tim_ker;
- struct clk_init_data init;
struct clk_hw *hw;
int err;