Skip to content

Commit add2180

Browse files
committed
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: d4b675e ("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]>
1 parent afbd65f commit add2180

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/input/misc/uinput.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,13 +689,14 @@ static ssize_t uinput_read(struct file *file, char __user *buffer,
689689
static __poll_t uinput_poll(struct file *file, poll_table *wait)
690690
{
691691
struct uinput_device *udev = file->private_data;
692+
__poll_t mask = EPOLLOUT | EPOLLWRNORM; /* uinput is always writable */
692693

693694
poll_wait(file, &udev->waitq, wait);
694695

695696
if (udev->head != udev->tail)
696-
return EPOLLIN | EPOLLRDNORM;
697+
mask |= EPOLLIN | EPOLLRDNORM;
697698

698-
return EPOLLOUT | EPOLLWRNORM;
699+
return mask;
699700
}
700701

701702
static int uinput_release(struct inode *inode, struct file *file)

0 commit comments

Comments
 (0)