[PATCH master 2/5] clk: fixed: record parent name in clk_register_fixed_rate

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jan 3 03:57:15 PST 2022


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

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 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




More information about the barebox mailing list