From: Charles Keepax Date: Fri, 19 Feb 2016 14:44:41 +0000 (+0000) Subject: ASoC: wm_adsp: Avoid narrow race condition on compr pointer X-Git-Tag: v4.6-rc1~101^2~9^2~8^5~4 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=c7dae7c4c60693286298e300b3d140c8cff46daa;p=linux.git 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 Signed-off-by: Mark Brown --- 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) goto out; } - if (compr->stream) + if (compr && compr->stream) snd_compr_fragment_elapsed(compr->stream); out: