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: <20230824191722.2701215-1-harshit.m.mogalapalli@oracle.com>
Date:   Thu, 24 Aug 2023 12:17:10 -0700
From:   Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Weidong Wang <wangweidong.a@...nic.com>,
        Arnd Bergmann <arnd@...db.de>,
        Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Cc:     dan.carpenter@...aro.org, kernel-janitors@...r.kernel.org,
        error27@...il.com, kernel test robot <lkp@...el.com>
Subject: [PATCH next] ASoC: codecs: Fix error code in aw88261_i2c_probe()

Passing zero to dev_err_probe is a success which is incorrect when
i2c_check_functionality() fails.

Fix this by passing -ENXIO instead of zero to dev_err_probe().

Fixes: 028a2ae25691 ("ASoC: codecs: Add aw88261 amplifier driver")
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <error27@...il.com>
Closes: https://lore.kernel.org/r/202308150315.CvOTIOKm-lkp@intel.com/
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
---
This is only compile tested.
---
 sound/soc/codecs/aw88261.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
index 6e2266b71386..a697b5006b45 100644
--- a/sound/soc/codecs/aw88261.c
+++ b/sound/soc/codecs/aw88261.c
@@ -1245,7 +1245,7 @@ static int aw88261_i2c_probe(struct i2c_client *i2c)
 
 	ret = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C);
 	if (!ret)
-		return dev_err_probe(&i2c->dev, ret, "check_functionality failed");
+		return dev_err_probe(&i2c->dev, -ENXIO, "check_functionality failed");
 
 	aw88261 = devm_kzalloc(&i2c->dev, sizeof(*aw88261), GFP_KERNEL);
 	if (!aw88261)
-- 
2.39.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ