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:
 <SE1P216MB2287962B462AE91B26248D19FD7E2@SE1P216MB2287.KORP216.PROD.OUTLOOK.COM>
Date: Tue, 8 Oct 2024 05:20:30 +0000
From: (Çлý) ÀåÀÎ±Ô (ÄÄÇ»ÅÍ°øÇаú)
	<ingyujang25@...st.ac.kr>
To: "perex@...ex.cz" <perex@...ex.cz>, "tiwai@...e.com" <tiwai@...e.com>,
	"hayashi.kunihiko@...ionext.com" <hayashi.kunihiko@...ionext.com>,
	"mhiramat@...nel.org" <mhiramat@...nel.org>
CC: "lgirdwood@...il.com" <lgirdwood@...il.com>, "broonie@...nel.org"
	<broonie@...nel.org>, "linux-sound@...r.kernel.org"
	<linux-sound@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>
Subject: [PATCH] ASoc: uniphier: Handle regmap_write errors in
 aio_iecout_set_enable()

From ae50796beac447467e6ecfa09bf40ac02b914e40 Mon Sep 17 00:00:00 2001
From: Ingyu Jang <ingyujang25@...st.ac.kr>
Date: Tue, 8 Oct 2024 14:11:11 +0900
Subject: [PATCH] ASoc: uniphier: Handle regmap_write errors in
 aio_iecout_set_enable()

The aio_oport_set_stream_type() function did not previously check the
return values of regmap_write().
If these functions fail, it could lead to silent failures when
configuring the audio playback port, causing improper behavior in audio
stream output via S/PDIF without any indication of an error.

This patch modifies aio_oport_set_stream_type() to check the return
values of regmap_write().
If regmap_write() fails, the error code is propagated back to the caller
to ensure proper error handling.

Signed-off-by: Ingyu Jang <ingyujang25@...st.ac.kr>
---
 sound/soc/uniphier/aio-core.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sound/soc/uniphier/aio-core.c b/sound/soc/uniphier/aio-core.c
index 0eba60758134..d334a5a08271 100644
--- a/sound/soc/uniphier/aio-core.c
+++ b/sound/soc/uniphier/aio-core.c
@@ -838,6 +838,7 @@ int aio_oport_set_stream_type(struct uniphier_aio_sub *sub,
 {
 	struct regmap *r = sub->aio->chip->regmap;
 	u32 repet = 0, pause = OPORTMXPAUDAT_PAUSEPC_CMN;
+	int ret;
 
 	switch (pc) {
 	case IEC61937_PC_AC3:
@@ -880,8 +881,13 @@ int aio_oport_set_stream_type(struct uniphier_aio_sub *sub,
 		break;
 	}
 
-	regmap_write(r, OPORTMXREPET(sub->swm->oport.map), repet);
-	regmap_write(r, OPORTMXPAUDAT(sub->swm->oport.map), pause);
+	ret = regmap_write(r, OPORTMXREPET(sub->swm->oport.map), repet);
+	if (ret)
+		return ret;
+	
+	ret = regmap_write(r, OPORTMXPAUDAT(sub->swm->oport.map), pause);
+	if (ret)
+		return ret;
 
 	return 0;
 }
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ