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: v3.16.83~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5113ebdbf286156689d2d55efb0588bebc6c3dcf;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 Signed-off-by: Jiri Kosina [bwh: Backported to 3.16: s/EPOLL/POLL/g] Signed-off-by: Ben Hutchings --- diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index 035c7c2863dc3..796b498993eb9 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -726,7 +726,7 @@ static unsigned int uhid_char_poll(struct file *file, poll_table *wait) if (uhid->head != uhid->tail) return POLLIN | POLLRDNORM; - return 0; + return POLLOUT | POLLWRNORM; } static const struct file_operations uhid_fops = {