sound/soc/codecs/aw88261.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202308150315.CvOTIOKm-lkp@intel.com/
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.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
On Thu, 24 Aug 2023 12:17:10 -0700, Harshit Mogalapalli wrote:
> 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().
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: codecs: Fix error code in aw88261_i2c_probe()
commit: 8886e1b03669c498f7a24bc5e483f46db5e81f82
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
© 2016 - 2025 Red Hat, Inc.