mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH for-4.15] ASoC: rt5514: don't assume rt5514 component was "attached"
@ 2017-12-16  1:12 Brian Norris
  2017-12-16  3:17 ` Brian Norris
  2018-01-24 15:36 ` Applied "ASoC: rt5514-spi: Check the validity of drvdata pointer on resume" to the asoc tree Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Brian Norris @ 2017-12-16  1:12 UTC (permalink / raw)
  To: Oder Chiou, Bard Liao, Liam Girdwood, Mark Brown
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel, Brian Norris

I've found that on Google's "Kevin" Chromebook, the rt5514 codec might
not be set up completely, yet its device is still present, and therefore
its PM suspend/resume is called. This hits a NULL pointer exception,
since we never had the chance to set our drvdata pointer.

This resolves crashes seen when trying to resume my system.

Fixes: e9c50aa6bd39 ("ASoC: rt5514-spi: check irq status to schedule data copy in resume function")
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This is a v4.15-rc1 regression

 sound/soc/codecs/rt5514-spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index 2df91db765ac..9255afcf2c3a 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -482,7 +482,7 @@ static int __maybe_unused rt5514_resume(struct device *dev)
 	if (device_may_wakeup(dev))
 		disable_irq_wake(irq);
 
-	if (rt5514_dsp->substream) {
+	if (rt5514_dsp && rt5514_dsp->substream) {
 		rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf));
 		if (buf[0] & RT5514_IRQ_STATUS_BIT)
 			rt5514_schedule_copy(rt5514_dsp);
-- 
2.15.1.504.g5279b80103-goog

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-16  1:12 [PATCH for-4.15] ASoC: rt5514: don't assume rt5514 component was "attached" Brian Norris
2017-12-16  3:17 ` Brian Norris
     [not found]   ` <CAFv8Nw+qiWedqZeVsPn17WiSyc_zwOP3bEnxn2Wc-oQ3ntgq2g@mail.gmail.com>
2017-12-18 17:42     ` Brian Norris
2017-12-19  7:38       ` Cheng-yi Chiang
2017-12-19 10:58       ` Mark Brown
2017-12-19 17:31         ` Brian Norris
2018-01-24 15:36 ` Applied "ASoC: rt5514-spi: Check the validity of drvdata pointer on resume" to the asoc tree Mark Brown
2018-01-24 15:47   ` Mark Brown
2018-01-24 17:07   ` Brian Norris

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

Powered by JetHome