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/mxs/clk-div.c | 2 +-
drivers/clk/mxs/clk-frac.c | 2 +-
drivers/clk/mxs/clk-pll.c | 2 +-
drivers/clk/mxs/clk-ref.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
@@ -70,9 +70,9 @@ static const struct clk_ops clk_div_ops = {
struct clk *mxs_clk_div(const char *name, const char *parent_name,
void __iomem *reg, u8 shift, u8 width, u8 busy)
{
+ struct clk_init_data init = {};
struct clk_div *div;
struct clk *clk;
- struct clk_init_data init;
div = kzalloc_obj(*div);
if (!div)
@@ -112,9 +112,9 @@ static const struct clk_ops clk_frac_ops = {
struct clk *mxs_clk_frac(const char *name, const char *parent_name,
void __iomem *reg, u8 shift, u8 width, u8 busy)
{
+ struct clk_init_data init = {};
struct clk_frac *frac;
struct clk *clk;
- struct clk_init_data init;
frac = kzalloc_obj(*frac);
if (!frac)
@@ -82,9 +82,9 @@ static const struct clk_ops clk_pll_ops = {
struct clk *mxs_clk_pll(const char *name, const char *parent_name,
void __iomem *base, u8 power, unsigned long rate)
{
+ struct clk_init_data init = {};
struct clk_pll *pll;
struct clk *clk;
- struct clk_init_data init;
pll = kzalloc_obj(*pll);
if (!pll)
@@ -113,9 +113,9 @@ static const struct clk_ops clk_ref_ops = {
struct clk *mxs_clk_ref(const char *name, const char *parent_name,
void __iomem *reg, u8 idx)
{
+ struct clk_init_data init = {};
struct clk_ref *ref;
struct clk *clk;
- struct clk_init_data init;
ref = kzalloc_obj(*ref);
if (!ref)