From: Dmitry Torokhov Date: Tue, 10 Jan 2012 08:45:12 +0000 (-0800) Subject: Input: serio_raw - really signal HUP upon disconnect X-Git-Tag: MMI-PSA29.97-13-9~8540^2~379 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0c62fbf6009fa338bd28bdcb14efbfc5fc0c579b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Input: serio_raw - really signal HUP upon disconnect Commit 8c1c10d5706bbb3b41cb4a5578339d67d3eeffc2 attempted to signal POLLHUP | POLLERR condition when polling disconnected device, unfortunately it did not do it quite correctly. Reported-by: Che-Liang Chiou Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index ca78a890c75d..f6c83e9ecff6 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c @@ -237,9 +237,9 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait) mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM; 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 = {