lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240717114024.3441163-1-make24@iscas.ac.cn>
Date: Wed, 17 Jul 2024 19:40:24 +0800
From: Ma Ke <make24@...as.ac.cn>
To: lgirdwood@...il.com,
	broonie@...nel.org,
	perex@...ex.cz,
	tiwai@...e.com,
	biju.das.jz@...renesas.com,
	jernej.skrabec@...il.com,
	claudiu.beznea@...on.dev,
	robh@...nel.org,
	make24@...as.ac.cn,
	kuninori.morimoto.gx@...esas.com
Cc: linux-sound@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] ASoC: ak4642: Return of_clk_add_provider to transfer the error

Return of_clk_add_provider() in order to transfer the error if it fails due
to insufficient memory allocation or failure to set clock defaults.

Fixes: 171a0138ab75 ("ASoC: ak4642: enable to use MCKO as fixed rate output pin on DT")
Signed-off-by: Ma Ke <make24@...as.ac.cn>
---
 sound/soc/codecs/ak4642.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c
index fe035d2fc913..2f1b295bca98 100644
--- a/sound/soc/codecs/ak4642.c
+++ b/sound/soc/codecs/ak4642.c
@@ -609,6 +609,7 @@ static struct clk *ak4642_of_parse_mcko(struct device *dev)
 	const char *clk_name = np->name;
 	const char *parent_clk_name = NULL;
 	u32 rate;
+	int ret;
 
 	if (of_property_read_u32(np, "clock-frequency", &rate))
 		return NULL;
@@ -619,8 +620,11 @@ static struct clk *ak4642_of_parse_mcko(struct device *dev)
 	of_property_read_string(np, "clock-output-names", &clk_name);
 
 	clk = clk_register_fixed_rate(dev, clk_name, parent_clk_name, 0, rate);
-	if (!IS_ERR(clk))
-		of_clk_add_provider(np, of_clk_src_simple_get, clk);
+	if (!IS_ERR(clk)) {
+		ret = of_clk_add_provider(np, of_clk_src_simple_get, clk);
+		if (ret)
+			return ERR_PTR(ret);
+	}
 
 	return clk;
 }
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ