aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-05-04 09:59:07 -0400
committerTakashi Iwai <tiwai@suse.de>2016-05-09 11:34:49 -0400
commite099aeea639ce491d3cd1c3802fe34d98045ffd8 (patch)
tree87f090215dc89255ef6a08bea3a82ed72e18c6a5 /sound/core
parent0c95c1d6197f3edd3f6ef76f927d67e8ec0794ed (diff)
ALSA: pcm: 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 <ckeepax@opensource.wolfsonmicro.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_native.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 9106d8e2300e..c61fd50f771f 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3161,7 +3161,7 @@ static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait)
3161 3161
3162 substream = pcm_file->substream; 3162 substream = pcm_file->substream;
3163 if (PCM_RUNTIME_CHECK(substream)) 3163 if (PCM_RUNTIME_CHECK(substream))
3164 return -ENXIO; 3164 return POLLOUT | POLLWRNORM | POLLERR;
3165 runtime = substream->runtime; 3165 runtime = substream->runtime;
3166 3166
3167 poll_wait(file, &runtime->sleep, wait); 3167 poll_wait(file, &runtime->sleep, wait);
@@ -3200,7 +3200,7 @@ static unsigned int snd_pcm_capture_poll(struct file *file, poll_table * wait)
3200 3200
3201 substream = pcm_file->substream; 3201 substream = pcm_file->substream;
3202 if (PCM_RUNTIME_CHECK(substream)) 3202 if (PCM_RUNTIME_CHECK(substream))
3203 return -ENXIO; 3203 return POLLIN | POLLRDNORM | POLLERR;
3204 runtime = substream->runtime; 3204 runtime = substream->runtime;
3205 3205
3206 poll_wait(file, &runtime->sleep, wait); 3206 poll_wait(file, &runtime->sleep, wait);