Skip to content

Commit

Permalink
ALSA: pcm: Fix poll error return codes
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Takashi Sakamoto <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
charleskeepax authored and tiwai committed May 9, 2016
1 parent 0c95c1d commit e099aee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -3161,7 +3161,7 @@ static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait)

substream = pcm_file->substream;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
return POLLOUT | POLLWRNORM | POLLERR;
runtime = substream->runtime;

poll_wait(file, &runtime->sleep, wait);
Expand Down Expand Up @@ -3200,7 +3200,7 @@ static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait)

substream = pcm_file->substream;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
return POLLIN | POLLRDNORM | POLLERR;
runtime = substream->runtime;

poll_wait(file, &runtime->sleep, wait);
Expand Down

0 comments on commit e099aee

Please sign in to comment.