Commit 0c62fbf6 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: serio_raw - really signal HUP upon disconnect

Commit 8c1c10d5 attempted to signal
POLLHUP | POLLERR condition when polling disconnected device,
unfortunately it did not do it quite correctly.
Reported-by: default avatarChe-Liang Chiou <clchiou@chromium.org>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent d89c9bcb
...@@ -237,9 +237,9 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait) ...@@ -237,9 +237,9 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait)
mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM; mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM;
if (serio_raw->head != serio_raw->tail) if (serio_raw->head != serio_raw->tail)
return POLLIN | POLLRDNORM; mask |= POLLIN | POLLRDNORM;
return 0; return mask;
} }
static const struct file_operations serio_raw_fops = { static const struct file_operations serio_raw_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