From 76127876b09a54f9fee7290e23d36754b398ecee Mon Sep 17 00:00:00 2001 From: Preetham Chandru Date: Thu, 12 Jan 2012 11:47:29 +0530 Subject: input: evdev: Initialize retval to zero In evdev_read() the local variable retval is not initialized. If this variable is not initialized then in case of NONBLOCK READ retval will have invalid value. Bug: 922453 Change-Id: I534cbfacf8a0514fcb5bc481a98d0e94a4d73b04 Signed-off-by: Preetham Chandru R Reviewed-on: http://git-master/r/74898 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Wadekar Reviewed-by: Sanjay Singh Rawat Tested-by: Sanjay Singh Rawat Reviewed-by: Shashank Sharma Reviewed-by: Yogish Kulkarni Reviewed-by: Kiran Adduri --- drivers/input/evdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 5c5f9db28075..6e7dd687d5c9 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -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; -- cgit v1.2.3