aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-02-19 09:44:41 -0500
committerMark Brown <broonie@kernel.org>2016-02-20 13:08:19 -0500
commitc7dae7c4c60693286298e300b3d140c8cff46daa (patch)
tree276a4911fa5106e5ebdb9f0916b5a7db6cc6032d
parentda2b33589013b4cb3dad163f50fae060896cb8b6 (diff)
ASoC: wm_adsp: Avoid narrow race condition on compr pointer
There is a very small window between then wm_adsp_compr_free gets call and when the DSP is actually powered down. If we get an IRQ from the DSP in this window then the wm_adsp_compr pointer will be NULL. This patch adds a check for this into the IRQ handler to avoid any issues when this happens. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/wm_adsp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 68b85ee67586..cb49a632462a 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -2845,7 +2845,7 @@ int wm_adsp_compr_handle_irq(struct wm_adsp *dsp)
2845 goto out; 2845 goto out;
2846 } 2846 }
2847 2847
2848 if (compr->stream) 2848 if (compr && compr->stream)
2849 snd_compr_fragment_elapsed(compr->stream); 2849 snd_compr_fragment_elapsed(compr->stream);
2850 2850
2851out: 2851out: