Skip to contentSkip to conversation

ALSA: seq: Fix poll() error return

PATCH New Takashi Iwai 1 participant 1 message Jul 25, 2018 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: seq: Fix poll() error return

The sanity checks in ALSA sequencer and OSS sequencer emulation codes return falsely -ENXIO from poll callback. They should be EPOLLERR instead.

This was caught thanks to the recent change to the return value.

---
 sound/core/seq/oss/seq_oss.c   | 2 +-
 sound/core/seq/seq_clientmgr.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
sound/core/seq/oss/seq_oss.c +1 -1
index 5f64d0d88320..e1f44fc86885 100644
@@ -203,7 +203,7 @@ odev_poll(struct file *file, poll_table * wait)
 	struct seq_oss_devinfo *dp;
 	dp = file->private_data;
 	if (snd_BUG_ON(!dp))
-		return -ENXIO;
+		return EPOLLERR;
 	return snd_seq_oss_poll(dp, file, wait);
 }
 
sound/core/seq/seq_clientmgr.c +1 -1
index 56ca78423040..6fd4b074b206 100644
@@ -1101,7 +1101,7 @@ static __poll_t snd_seq_poll(struct file *file, poll_table * wait)
 
 	/* check client structures are in place */
 	if (snd_BUG_ON(!client))
-		return -ENXIO;
+		return EPOLLERR;
 
 	if ((snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_INPUT) &&
 	    client->data.user.fifo) {
Signature · 1 line
2.18.0