Re: [PATCH 4.19 79/99] ASoC: wm_adsp: Correct handling of compressed streams that restart

From: Nobuhiro Iwamatsu
Date: Tue May 07 2019 - 04:45:35 EST


Hi,

On Mon, May 06, 2019 at 04:32:52PM +0200, Greg Kroah-Hartman wrote:
> From: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
>
> commit 639e5eb3c7d67e407f2a71fccd95323751398f6f upstream.
>
> Previously support was added to allow streams to be stopped and
> started again without the DSP being power cycled and this was done
> by clearing the buffer state in trigger start. Another supported
> use-case is using the DSP for a trigger event then opening the
> compressed stream later to receive the audio, unfortunately clearing
> the buffer state in trigger start destroys the data received
> from such a trigger. Correct this issue by moving the call to
> wm_adsp_buffer_clear to be in trigger stop instead.
>
> Fixes: 61fc060c40e6 ("ASoC: wm_adsp: Support streams which can start/stop with DSP active")
> Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

This commit has other problems, and it is fixed by commit 43d147be5738a9ed6cfb25c285ac50d6dd5793be.
Please apply this commit too.

commit 43d147be5738a9ed6cfb25c285ac50d6dd5793be
Author: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue Apr 2 13:49:14 2019 +0100

ASoC: wm_adsp: Check for buffer in trigger stop

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@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>

Best regards,
Nobuhiro