* [PATCH] ASoC: tlv320adcx140: Fix accessing uninitialized abcx140->dev
@ 2020-09-01 7:27 Camel Guo
2020-09-01 11:22 ` Dan Murphy
0 siblings, 1 reply; 2+ messages in thread
From: Camel Guo @ 2020-09-01 7:27 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, dmurphy
Cc: Camel Guo, alsa-devel, kernel, linux-kernel, Camel Guo
From: Camel Guo <camelg@axis.com>
in adcx140_i2c_probe, adcx140->dev is accessed before its
initialization. This commit fixes this bug.
Signed-off-by: Camel Guo <camel.guo@axis.com>
---
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 related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: tlv320adcx140: Fix accessing uninitialized abcx140->dev
2020-09-01 7:27 [PATCH] ASoC: tlv320adcx140: Fix accessing uninitialized abcx140->dev Camel Guo
@ 2020-09-01 11:22 ` Dan Murphy
0 siblings, 0 replies; 2+ messages in thread
From: Dan Murphy @ 2020-09-01 11:22 UTC (permalink / raw)
To: Camel Guo, lgirdwood, broonie, perex, tiwai
Cc: alsa-devel, kernel, linux-kernel, Camel Guo
Camel
On 9/1/20 2:27 AM, Camel Guo wrote:
> From: Camel Guo <camelg@axis.com>
>
> in adcx140_i2c_probe, adcx140->dev is accessed before its
> initialization. This commit fixes this bug.
s/abc/adc in the subject
and
s/in/In
Also please add a Fixes tag.
Otherwise
Acked-by: Dan Murphy <dmurphy@ti.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-01 11:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-01 7:27 [PATCH] ASoC: tlv320adcx140: Fix accessing uninitialized abcx140->dev Camel Guo
2020-09-01 11:22 ` Dan Murphy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox