From: Marcel Holtmann Date: Wed, 4 Dec 2019 02:43:55 +0000 (+0100) Subject: HID: uhid: Fix returning EPOLLOUT from uhid_char_poll X-Git-Tag: v4.4.210~22 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=7a887f88482b21afad5333d7959ed66332b8a764;p=thirdparty%2Fkernel%2Fstable.git HID: uhid: Fix returning EPOLLOUT from uhid_char_poll commit be54e7461ffdc5809b67d2aeefc1ddc9a91470c7 upstream. Always return EPOLLOUT from uhid_char_poll to allow polling /dev/uhid for writable state. Fixes: 1f9dec1e0164 ("HID: uhid: allow poll()'ing on uhid devices") Signed-off-by: Marcel Holtmann Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index f6863adc15ad4..ea0c860ee8424 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -26,6 +26,7 @@ #include #include #include +#include #define UHID_NAME "uhid" #define UHID_BUFSIZE 32 @@ -774,7 +775,7 @@ static unsigned int uhid_char_poll(struct file *file, poll_table *wait) if (uhid->head != uhid->tail) return POLLIN | POLLRDNORM; - return 0; + return EPOLLOUT | EPOLLWRNORM; } static const struct file_operations uhid_fops = {