]> Git Repo - linux.git/commitdiff
Input: uinput - always report EPOLLOUT
authorDmitry Torokhov <[email protected]>
Fri, 13 Dec 2019 22:03:56 +0000 (14:03 -0800)
committerDmitry Torokhov <[email protected]>
Fri, 13 Dec 2019 23:00:30 +0000 (15:00 -0800)
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")
Reported-by: Linus Torvalds <[email protected]>
Link: https://lore.kernel.org/r/20191209202254.GA107567@dtor-ws
Signed-off-by: Dmitry Torokhov <[email protected]>
drivers/input/misc/uinput.c

index fd253781be711d306a4f0f41ffa59bac1a284000..0bb456015d8f4a997528c57fd57e0a6ab8a43a1d 100644 (file)
@@ -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)
This page took 0.058764 seconds and 4 git commands to generate.