mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 2/5] clk: fixed: record parent name in clk_register_fixed_rate
Date: Mon,  3 Jan 2022 12:57:15 +0100	[thread overview]
Message-ID: <20220103115718.1723730-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20220103115718.1723730-1-a.fatoum@pengutronix.de>

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

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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  parent reply	other threads:[~2022-01-03 11:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-03 11:57 [PATCH master 0/5] misc fixes Ahmad Fatoum
2022-01-03 11:57 ` [PATCH master 1/5] pwm: atmel: point MMIO accesses at correct address Ahmad Fatoum
2022-01-03 16:11   ` Sam Ravnborg
2022-01-03 16:18     ` Sam Ravnborg
2022-01-03 11:57 ` Ahmad Fatoum [this message]
2022-01-03 11:57 ` [PATCH master 3/5] imx-bbu-nand-fcb: suppress compiler warning about uninitialized use Ahmad Fatoum
2022-01-03 11:57 ` [PATCH master 4/5] regulator: fix broken reference counting on disable Ahmad Fatoum
2022-01-03 11:57 ` [PATCH master 5/5] regulator: respect "regulator-always-on" property Ahmad Fatoum
2022-01-05  7:28 ` [PATCH master 0/5] misc fixes Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220103115718.1723730-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox