Skip to content

Commit

Permalink
ASoC: wm_adsp: Treat missing compressed buffer as a fatal error
Browse files Browse the repository at this point in the history
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: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Charles Keepax authored and Mark Brown committed Jun 13, 2016
1 parent 8d28066 commit 28ee3d7
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions sound/soc/codecs/wm_adsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 28ee3d7

Please sign in to comment.