]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: wm_adsp: Avoid narrow race condition on compr pointer
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Fri, 19 Feb 2016 14:44:41 +0000 (14:44 +0000)
committerMark Brown <broonie@kernel.org>
Sat, 20 Feb 2016 18:08:19 +0000 (03:08 +0900)
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>
sound/soc/codecs/wm_adsp.c

index 68b85ee67586af7880e341ec4b092db0e6fa0c45..cb49a632462a3b5588de708e4c0cc3191776ab60 100644 (file)
@@ -2845,7 +2845,7 @@ int wm_adsp_compr_handle_irq(struct wm_adsp *dsp)
                goto out;
        }
 
-       if (compr->stream)
+       if (compr && compr->stream)
                snd_compr_fragment_elapsed(compr->stream);
 
 out: