Skip to content

Commit 28ee3d7

Browse files
charleskeepaxbroonie
authored andcommitted
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: Charles Keepax <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 8d28066 commit 28ee3d7

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

sound/soc/codecs/wm_adsp.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,12 +3037,7 @@ int wm_adsp_compr_pointer(struct snd_compr_stream *stream,
30373037

30383038
buf = compr->buf;
30393039

3040-
if (!compr->buf) {
3041-
ret = -ENXIO;
3042-
goto out;
3043-
}
3044-
3045-
if (compr->buf->error) {
3040+
if (!compr->buf || compr->buf->error) {
30463041
snd_compr_stop_error(stream, SNDRV_PCM_STATE_XRUN);
30473042
ret = -EIO;
30483043
goto out;
@@ -3161,10 +3156,7 @@ static int wm_adsp_compr_read(struct wm_adsp_compr *compr,
31613156

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

3164-
if (!compr->buf)
3165-
return -ENXIO;
3166-
3167-
if (compr->buf->error) {
3159+
if (!compr->buf || compr->buf->error) {
31683160
snd_compr_stop_error(compr->stream, SNDRV_PCM_STATE_XRUN);
31693161
return -EIO;
31703162
}

0 commit comments

Comments
 (0)