* [RESEND PATCH] ASoC: rt5514-spi: Check the validity of drvdata pointer on resume
@ 2018-01-24 14:50 Marc Zyngier
0 siblings, 0 replies; only message in thread
From: Marc Zyngier @ 2018-01-24 14:50 UTC (permalink / raw)
To: Oder Chiou, Mark Brown, Bard Liao; +Cc: alsa-devel, linux-kernel
The rt5514-spi driver seem to assume the validity of the drvdata pointer
on resume, which it may not be populated, leading to a not-so-nice crash.
This stems from the fact that rt5514_spi_pcm_probe() is never called on
my system (a kevin Chromebook). No idea why, but if it can happen, it
is worth fixing.
Fixes: e9c50aa6bd39 ("ASoC: rt5514-spi: check irq status to schedule data copy in resume function")
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
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.14.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-01-24 14:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24 14:50 [RESEND PATCH] ASoC: rt5514-spi: Check the validity of drvdata pointer on resume Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).