Input: evdev - fix variable initialisation
authorHeiko Stuebner <heiko@sntech.de>
Wed, 1 Feb 2012 18:33:01 +0000 (10:33 -0800)
committer黄涛 <huangtao@rock-chips.com>
Tue, 8 May 2012 05:10:06 +0000 (13:10 +0800)
Commit 509f87c5f564 (evdev - do not block waiting for an event if
fd
is nonblock) created a code path were it was possible to use retval
uninitialized.

This could lead to the xorg evdev input driver getting corrupt data
and refusing to work with log messages like
AUO-Pixcir touchscreen: Read error: Success
sg060_keys: Read error: Success
AUO-Pixcir touchscreen: Read error: Success
sg060_keys: Read error: Success
(for drivers auo-pixcir-ts and gpio-keys).

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/input/evdev.c

index 5c5f9db280755cfe7cc4742a1d5fbb9ddc5d511e..6e7dd687d5c9e3804902b9a059034375343f4a1a 100644 (file)
@@ -400,7 +400,7 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
        struct evdev_client *client = file->private_data;
        struct evdev *evdev = client->evdev;
        struct input_event event;
-       int retval;
+       int retval = 0;
 
        if (count < input_event_size())
                return -EINVAL;