Commit c4aa4f2c authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Khalid Elmously

HID: uhid: Fix returning EPOLLOUT from uhid_char_poll

BugLink: https://bugs.launchpad.net/bugs/1859865

commit be54e746 upstream.

Always return EPOLLOUT from uhid_char_poll to allow polling /dev/uhid
for writable state.

Fixes: 1f9dec1e ("HID: uhid: allow poll()'ing on uhid devices")
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent a393f2a1
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/uhid.h> #include <linux/uhid.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/eventpoll.h>
#define UHID_NAME "uhid" #define UHID_NAME "uhid"
#define UHID_BUFSIZE 32 #define UHID_BUFSIZE 32
...@@ -774,7 +775,7 @@ static unsigned int uhid_char_poll(struct file *file, poll_table *wait) ...@@ -774,7 +775,7 @@ static unsigned int uhid_char_poll(struct file *file, poll_table *wait)
if (uhid->head != uhid->tail) if (uhid->head != uhid->tail)
return POLLIN | POLLRDNORM; return POLLIN | POLLRDNORM;
return 0; return EPOLLOUT | EPOLLWRNORM;
} }
static const struct file_operations uhid_fops = { static const struct file_operations uhid_fops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment