[PATCH 36/39] input: Fix an oops at opentime of /dev/input/event devices

Vojtech Pavlik
2004-06-07T13:08:13Z

ChangeSet@1.1371.539.2, 2004-05-14 10:23:53+02:00, async@cc.gatech.edu
evdev.c:
input: Fix an oops at opentime of /dev/input/event devices

evdev.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

===================================================================

diff -Nru a/drivers/input/evdev.c b/drivers/input/evdev.c
--- a/drivers/input/evdev.c 2004-06-07 13:10:32 +02:00
+++ b/drivers/input/evdev.c 2004-06-07 13:10:32 +02:00
@@ -126,7 +126,7 @@
int i = iminor(inode) - EVDEV_MINOR_BASE;
int accept_err;

- if (i >= EVDEV_MINORS || !evdev_table[i])
+ if (i >= EVDEV_MINORS || !evdev_table[i] || !evdev_table[i]->exist)
return -ENODEV;

if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file)))
@@ -175,7 +175,7 @@
return -EAGAIN;

retval = wait_event_interruptible(list->evdev->wait,
- list->head != list->tail && list->evdev->exist);
+ list->head != list->tail || (!list->evdev->exist));

if (retval)
return retval;