parent_names is allocated, but only populated with zeroes. Fix this.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 drivers/clk/clk-fixed.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/clk-fixed.c b/drivers/clk/clk-fixed.c
index b961c382ec22..e813f31d76d9 100644
--- a/drivers/clk/clk-fixed.c
+++ b/drivers/clk/clk-fixed.c
@@ -45,6 +45,10 @@ struct clk *clk_register_fixed_rate(const char *name,
                if (!parent_names)
                        return ERR_PTR(-ENOMEM);
 
+               parent_names[0] = strdup(parent_name);
+               if (!parent_names[0])
+                       return ERR_PTR(-ENOMEM);
+
                fix->hw.clk.parent_names = parent_names;
                fix->hw.clk.num_parents = 1;
        }
-- 
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to