From: Charles Keepax Date: Wed, 4 May 2016 13:59:10 +0000 (+0100) Subject: ALSA: compress: Fix poll error return codes X-Git-Tag: v4.7-rc1~116^2~4^2~15 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=1d03f2bd56f3a45123a7572fb536c063068cfb83;p=linux.git ALSA: compress: Fix poll error return codes We can't return a negative error code from the poll callback the return type is unsigned and is checked against the poll specific flags we need to return POLLERR if we encounter an error. Signed-off-by: Charles Keepax Acked-by: Vinod Koul Signed-off-by: Takashi Iwai --- diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 5215df2940b3..f56f4e358b76 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -391,13 +391,13 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait) int retval = 0; if (snd_BUG_ON(!data)) - return -EFAULT; + return POLLERR; stream = &data->stream; mutex_lock(&stream->device->lock); if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) { - retval = -EBADFD; + retval = snd_compr_get_poll(stream) | POLLERR; goto out; } poll_wait(f, &stream->runtime->sleep, wait);