summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2019-04-02 13:49:14 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-08 07:21:55 +0200
commit5b94768bd07cdfbe3253ccd016add54681c3179c (patch)
tree9e788eee9635b6ab2112d7069b6fd248e96d812f /sound/soc
parentc5c74e63985fb7059656ed8640de712805ee4e74 (diff)
downloadlinux-stable-5b94768bd07cdfbe3253ccd016add54681c3179c.tar.gz
linux-stable-5b94768bd07cdfbe3253ccd016add54681c3179c.tar.bz2
linux-stable-5b94768bd07cdfbe3253ccd016add54681c3179c.zip
ASoC: wm_adsp: Check for buffer in trigger stop
commit 43d147be5738a9ed6cfb25c285ac50d6dd5793be upstream. Trigger stop can be called in situations where trigger start failed and as such it can't be assumed the buffer is already attached to the compressed stream or a NULL pointer may be dereferenced. Fixes: 639e5eb3c7d6 ("ASoC: wm_adsp: Correct handling of compressed streams that restart") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/wm_adsp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index b1a5ab95fcc9..a651fed62a27 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -3452,7 +3452,8 @@ int wm_adsp_compr_trigger(struct snd_compr_stream *stream, int cmd)
}
break;
case SNDRV_PCM_TRIGGER_STOP:
- wm_adsp_buffer_clear(compr->buf);
+ if (wm_adsp_compr_attached(compr))
+ wm_adsp_buffer_clear(compr->buf);
break;
default:
ret = -EINVAL;