Skip to contentSkip to conversation

Input: uinput - always report EPOLLOUT

PATCH New Dmitry Torokhov 1 participant 1 message Dec 9, 2019

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: uinput - always report EPOLLOUT

uinput device is always available for writing so we should always report EPOLLOUT and EPOLLWRNORM bits, not only when there is nothing to read from the device.

Fixes d4b675e1b527 ("Input: uinput - fix returning EPOLLOUT from uinput_poll")
---
 drivers/input/misc/uinput.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/input/misc/uinput.c +3 -2
index fd253781be71..0bb456015d8f 100644
@@ -689,13 +689,14 @@ static ssize_t uinput_read(struct file *file, char __user *buffer,
 static __poll_t uinput_poll(struct file *file, poll_table *wait)
 {
 	struct uinput_device *udev = file->private_data;
+	__poll_t mask = EPOLLOUT | EPOLLWRNORM; /* uinput is always writable */
 
 	poll_wait(file, &udev->waitq, wait);
 
 	if (udev->head != udev->tail)
-		return EPOLLIN | EPOLLRDNORM;
+		mask |= EPOLLIN | EPOLLRDNORM;
 
-	return EPOLLOUT | EPOLLWRNORM;
+	return mask;
 }
 
 static int uinput_release(struct inode *inode, struct file *file)
Signature · 5 lines
2.24.0.393.g34dc348eaf-goog


-- 
Dmitry