hiddev: Return EPOLLOUT from hiddev_poll
diff mbox series

Message ID ad32bc93-e833-d729-3b96-f18146c9099a@gmail.com
State Mainlined
Delegated to: Jiri Kosina
Headers show
  • hiddev: Return EPOLLOUT from hiddev_poll
Related show

Commit Message

Fabian Henneke July 18, 2019, 8:50 p.m. UTC
Always return EPOLLOUT from hiddev_poll when a device is connected.
This is safe since hiddev_write always fails and improves compatibility
with tools like socat.

Signed-off-by: Fabian Henneke <fabian@henneke.me>
In-reply-to: <nycvar.YFH.7.76.1907171333160.5899@cbobk.fhfr.pm>
 drivers/hid/usbhid/hiddev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 55b72573066b..73a76d9af974 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -416,7 +416,7 @@  static __poll_t hiddev_poll(struct file *file, poll_table *wait)

        poll_wait(file, &list->hiddev->wait, wait);
        if (list->head != list->tail)
-               return EPOLLIN | EPOLLRDNORM;
+               return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
        if (!list->hiddev->exist)
                return EPOLLERR | EPOLLHUP;
        return 0;