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: <20251217025051.2196-1-vulab@iscas.ac.cn>
Date: Wed, 17 Dec 2025 10:50:51 +0800
From: Haotian Zhang <vulab@...as.ac.cn>
To: Shenghao Ding <shenghao-ding@...com>,
	Kevin Lu <kevin-lu@...com>,
	Baojun Xu <baojun.xu@...com>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>
Cc: Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	linux-sound@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Haotian Zhang <vulab@...as.ac.cn>
Subject: [PATCH] ASoC: tlv320aic32x4: Fix missing error check for devm_clk_register()

aic32x4_register_clocks() ignores the return value of
aic32x4_register_clk(), which returns the result of
devm_clk_register(). This causes the driver to ignore
clock registration errors and return success even if
devm_clk_register() fails.

Check the return value of aic32x4_register_clk() and
return the error code if registration fails. The
aic32x4_probe() has already implemented the check for the
return value of aic32x4_register_clocks().

Fixes: 514b044cba66 ("ASoC: tlv320aic32x4: Model PLL in CCF")
Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
---
 sound/soc/codecs/tlv320aic32x4-clk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tlv320aic32x4-clk.c b/sound/soc/codecs/tlv320aic32x4-clk.c
index 5c0a76a4a106..8f04df2a25d1 100644
--- a/sound/soc/codecs/tlv320aic32x4-clk.c
+++ b/sound/soc/codecs/tlv320aic32x4-clk.c
@@ -479,6 +479,7 @@ static struct clk *aic32x4_register_clk(struct device *dev,
 int aic32x4_register_clocks(struct device *dev, const char *mclk_name)
 {
 	int i;
+	struct clk *clk;
 
 	/*
 	 * These lines are here to preserve the current functionality of
@@ -492,7 +493,9 @@ int aic32x4_register_clocks(struct device *dev, const char *mclk_name)
 			(const char *[]) { mclk_name, "bclk", "gpio", "pll" };
 
 	for (i = 0; i < ARRAY_SIZE(aic32x4_clkdesc_array); ++i)
-		aic32x4_register_clk(dev, &aic32x4_clkdesc_array[i]);
+		clk = aic32x4_register_clk(dev, &aic32x4_clkdesc_array[i]);
+		if (IS_ERR(clk))
+			return PTR_ERR(clk);
 
 	return 0;
 }
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ