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: <aSW1UOgMCiQIaZG8@stanley.mountain>
Date: Tue, 25 Nov 2025 16:55:28 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.dev>
Cc: Charles Keepax <ckeepax@...nsource.cirrus.com>,
	Maciej Strozek <mstrozek@...nsource.cirrus.com>,
	Bard Liao <yung-chuan.liao@...ux.intel.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	Peter Ujfalusi <peter.ujfalusi@...ux.intel.com>,
	Vinod Koul <vkoul@...nel.org>, linux-sound@...r.kernel.org,
	patches@...nsource.cirrus.com, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: [PATCH next] ASoC: SDCA: Fix NULL vs IS_ERR() bug in
 sdca_dev_register_functions()

The sdca_dev_register() function never returns NULL, it returns error
pointers on error.  Fix the error checking to match.

Fixes: 4496d1c65bad ("ASoC: SDCA: add function devices")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
 sound/soc/sdca/sdca_function_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sdca/sdca_function_device.c b/sound/soc/sdca/sdca_function_device.c
index 91c49d7389db..c6cc880a150e 100644
--- a/sound/soc/sdca/sdca_function_device.c
+++ b/sound/soc/sdca/sdca_function_device.c
@@ -96,8 +96,8 @@ int sdca_dev_register_functions(struct sdw_slave *slave)
 
 		func_dev = sdca_dev_register(&slave->dev,
 					     &sdca_data->function[i]);
-		if (!func_dev)
-			return -ENODEV;
+		if (IS_ERR(func_dev))
+			return PTR_ERR(func_dev);
 
 		sdca_data->function[i].func_dev = func_dev;
 	}
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ