mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev
@ 2020-09-01 13:57 Camel Guo
  2020-09-01 15:17 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Camel Guo @ 2020-09-01 13:57 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, dmurphy
  Cc: alsa-devel, linux-kernel, kernel, Camel Guo, Camel Guo

From: Camel Guo <camelg@axis.com>

In adcx140_i2c_probe, adcx140->dev is accessed before its
initialization. This commit fixes this bug.

Fixes: 689c7655b50c ("ASoC: tlv320adcx140: Add the tlv320adcx140 codec driver family")
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Camel Guo <camel.guo@axis.com>
---
 v4:
   - Add Acked-By from Dan
 v3:
   - Add Fixes tag
 v2:
   - Fix typo

 sound/soc/codecs/tlv320adcx140.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tlv320adcx140.c b/sound/soc/codecs/tlv320adcx140.c
index 5cd50d841177..7ae6ec374be3 100644
--- a/sound/soc/codecs/tlv320adcx140.c
+++ b/sound/soc/codecs/tlv320adcx140.c
@@ -980,6 +980,8 @@ static int adcx140_i2c_probe(struct i2c_client *i2c,
 	if (!adcx140)
 		return -ENOMEM;
 
+	adcx140->dev = &i2c->dev;
+
 	adcx140->gpio_reset = devm_gpiod_get_optional(adcx140->dev,
 						      "reset", GPIOD_OUT_LOW);
 	if (IS_ERR(adcx140->gpio_reset))
@@ -1007,7 +1009,7 @@ static int adcx140_i2c_probe(struct i2c_client *i2c,
 			ret);
 		return ret;
 	}
-	adcx140->dev = &i2c->dev;
+
 	i2c_set_clientdata(i2c, adcx140);
 
 	return devm_snd_soc_register_component(&i2c->dev,
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v4] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev
  2020-09-01 13:57 [PATCH v4] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev Camel Guo
@ 2020-09-01 15:17 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-09-01 15:17 UTC (permalink / raw)
  To: Camel Guo, perex, tiwai, lgirdwood, dmurphy
  Cc: Camel Guo, kernel, linux-kernel, alsa-devel

On Tue, 1 Sep 2020 15:57:35 +0200, Camel Guo wrote:
> In adcx140_i2c_probe, adcx140->dev is accessed before its
> initialization. This commit fixes this bug.

Applied to

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

Thanks!

[1/1] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev
      commit: 2569231d71dff82cfd6e82ab3871776f72ec53b6

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-01 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 13:57 [PATCH v4] ASoC: tlv320adcx140: Fix accessing uninitialized adcx140->dev Camel Guo
2020-09-01 15:17 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®