[PATCH] ASoc: TAS2781: Fix tasdev_load_calibrated_data()

Dan Carpenter posted 1 patch 1 year, 6 months ago
sound/soc/codecs/tas2781-fmwlib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] ASoc: TAS2781: Fix tasdev_load_calibrated_data()
Posted by Dan Carpenter 1 year, 6 months ago
This function has a reversed if statement so it's either a no-op or it
leads to a NULL dereference.

Fixes: b195acf5266d ("ASoC: tas2781: Fix wrong loading calibrated data sequence")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 sound/soc/codecs/tas2781-fmwlib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tas2781-fmwlib.c b/sound/soc/codecs/tas2781-fmwlib.c
index 63626b982d04..8f9a3ae7153e 100644
--- a/sound/soc/codecs/tas2781-fmwlib.c
+++ b/sound/soc/codecs/tas2781-fmwlib.c
@@ -2162,7 +2162,7 @@ static void tasdev_load_calibrated_data(struct tasdevice_priv *priv, int i)
 		return;
 
 	cal = cal_fmw->calibrations;
-	if (cal)
+	if (!cal)
 		return;
 
 	load_calib_data(priv, &cal->dev_data);
-- 
2.43.0
Re: [PATCH] ASoc: TAS2781: Fix tasdev_load_calibrated_data()
Posted by Mark Brown 1 year, 6 months ago
On Fri, 19 Jul 2024 18:53:48 -0500, Dan Carpenter wrote:
> This function has a reversed if statement so it's either a no-op or it
> leads to a NULL dereference.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoc: TAS2781: Fix tasdev_load_calibrated_data()
      commit: 92c78222168e9035a9bfb8841c2e56ce23e51f73

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