linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: uhid: Fix returning EPOLLOUT from uhid_char_poll
@ 2019-12-04  2:43 Marcel Holtmann
  2019-12-09 12:53 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Marcel Holtmann @ 2019-12-04  2:43 UTC (permalink / raw)
  To: David Herrmann, Jiri Kosina, Benjamin Tissoires
  Cc: Fabian Henneke, linux-input, linux-kernel

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>
Cc: stable@vger.kernel.org
---
 drivers/hid/uhid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index fa0cc0899827..935c3d0a3b63 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -772,7 +772,7 @@ static __poll_t uhid_char_poll(struct file *file, poll_table *wait)
 	if (uhid->head != uhid->tail)
 		return EPOLLIN | EPOLLRDNORM;
 
-	return 0;
+	return EPOLLOUT | EPOLLWRNORM;
 }
 
 static const struct file_operations uhid_fops = {
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: uhid: Fix returning EPOLLOUT from uhid_char_poll
  2019-12-04  2:43 [PATCH] HID: uhid: Fix returning EPOLLOUT from uhid_char_poll Marcel Holtmann
@ 2019-12-09 12:53 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2019-12-09 12:53 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: David Herrmann, Benjamin Tissoires, Fabian Henneke, linux-input,
	linux-kernel

On Wed, 4 Dec 2019, Marcel Holtmann wrote:

> 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>
> Cc: stable@vger.kernel.org

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-09 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04  2:43 [PATCH] HID: uhid: Fix returning EPOLLOUT from uhid_char_poll Marcel Holtmann
2019-12-09 12:53 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).