Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e099aeea authored by Charles Keepax's avatar Charles Keepax Committed by Takashi Iwai
Browse files

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: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0c95c1d6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
@@ -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);