Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28ee3d73 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown
Browse files

ASoC: wm_adsp: Treat missing compressed buffer as a fatal error



If the DSP is powered down whilst a compressed stream is being processed
we should treat this as a fatal error, clearly the stream is no longer
valid.

Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8d280664
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -3037,12 +3037,7 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,

	buf = compr->buf;

	if (!compr->buf) {
		ret = -ENXIO;
		goto out;
	}

	if (compr->buf->error) {
	if (!compr->buf || compr->buf->error) {
		snd_compr_stop_error(stream, SNDRV_PCM_STATE_XRUN);
		ret = -EIO;
		goto out;
@@ -3161,10 +3156,7 @@ static int wm_adsp_compr_read(struct wm_adsp_compr *compr,

	adsp_dbg(dsp, "Requested read of %zu bytes\n", count);

	if (!compr->buf)
		return -ENXIO;

	if (compr->buf->error) {
	if (!compr->buf || compr->buf->error) {
		snd_compr_stop_error(compr->stream, SNDRV_PCM_STATE_XRUN);
		return -EIO;
	}