input: don't use unintialized memory
authornotaz <notasas@gmail.com>
Sat, 19 Mar 2011 22:34:27 +0000 (22:34 +0000)
committernotaz <notasas@gmail.com>
Sat, 19 Mar 2011 22:34:27 +0000 (22:34 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@922 be3aeb3a-fb24-0410-a615-afba39da0efa

linux/in_evdev.c

index e6bdad1..d863c02 100644 (file)
@@ -585,10 +585,11 @@ static int in_evdev_clean_binds(void *drv_data, int *binds, int *def_binds)
        in_evdev_t *dev = drv_data;
        int i, t, ret, offs, count = 0;
 
+       memset(keybits, 0, sizeof(keybits));
        ret = ioctl(dev->fd, EVIOCGBIT(EV_KEY, sizeof(keybits)), keybits);
        if (ret == -1) {
                perror("in_evdev: ioctl failed");
-               memset(keybits, 0xff, sizeof(keybits)); /* mark all as good */
+               // memset(keybits, 0xff, sizeof(keybits)); /* mark all as good */
        }
 
        if (dev->abs_lzone != 0) {