]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
HID: uhid: Fix returning EPOLLOUT from uhid_char_poll
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 4 Dec 2019 02:43:55 +0000 (03:43 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:02:43 +0000 (19:02 +0100)
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 <marcel@holtmann.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[bwh: Backported to 3.16: s/EPOLL/POLL/g]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/hid/uhid.c

index 035c7c2863dc37564cc5590001cf0a0c0ddee540..796b498993eb99d6fba624c62a3f97ad3d79ea90 100644 (file)
@@ -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 = {