[PATCH 3/47] Fix an oops in poll() on uinput.

Vojtech Pavlik
2004-07-29T14:56:54Z

ChangeSet@1.1612.1.22, 2004-05-28 22:57:43+02:00, vojtech@suse.cz
input: Fix an oops in poll() on uinput. Thanks to Dmitry Torokhov
for suggesting the fix.

uinput.c | 3 +++
1 files changed, 3 insertions(+)

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

diff -Nru a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
--- a/drivers/input/misc/uinput.c Thu Jul 29 14:42:19 2004
+++ b/drivers/input/misc/uinput.c Thu Jul 29 14:42:19 2004
@@ -279,6 +279,9 @@
{
struct uinput_device *udev = file->private_data;

+ if (!test_bit(UIST_CREATED, &(udev->state)))
+ return -ENODEV;
+
poll_wait(file, &udev->waitq, wait);

if (udev->head != udev->tail)