aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/hid/hid-wiimote-debug.c
diff options
context:
space:
mode:
authorSimon Que <sque@chromium.org>2013-01-17 13:02:52 -0800
committerJiri Kosina <jkosina@suse.cz>2013-01-18 10:59:24 +0100
commitb77a989acca3fb4d09c2d8c3749499c663f5ab9f (patch)
tree17f7716e21657fd59523cbb528dfdcf4d42630a6 /drivers/hid/hid-wiimote-debug.c
parentHID: Support Jess/Saitek Color Rumble Pad (diff)
downloadwireguard-linux-b77a989acca3fb4d09c2d8c3749499c663f5ab9f.tar.xz
wireguard-linux-b77a989acca3fb4d09c2d8c3749499c663f5ab9f.zip
HID: Fix uninitialized variable "size" in hid-wiimote-debug
This variable is initialized conditionally, based on whether a wiimote call succeeds. However, the logic is not obvious to the compiler so it throws a warning. Eliminate the warning by initializing "size" to 0. The warning is: files/drivers/hid/hid-wiimote-debug.c:69:18: warning: 'size' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Simon Que <sque@chromium.org> Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-wiimote-debug.c')
-rw-r--r--drivers/hid/hid-wiimote-debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-wiimote-debug.c b/drivers/hid/hid-wiimote-debug.c
index eec329197c16..90124ffaa2a5 100644
--- a/drivers/hid/hid-wiimote-debug.c
+++ b/drivers/hid/hid-wiimote-debug.c
@@ -31,7 +31,7 @@ static ssize_t wiidebug_eeprom_read(struct file *f, char __user *u, size_t s,
unsigned long flags;
ssize_t ret;
char buf[16];
- __u16 size;
+ __u16 size = 0;
if (s == 0)
return -EINVAL;