]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Input: synaptics - clear device info before filling in
authorEric Biggers <ebiggers@google.com>
Tue, 30 May 2017 02:57:19 +0000 (19:57 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 30 May 2017 03:00:10 +0000 (20:00 -0700)
synaptics_query_hardware() was being passed a 'struct synaptics_device_info'
in uninitialized stack memory, then not always initializing all fields.
This caused garbage to show up in certain fields, making the touchpad
unusable.

Fix by zeroing the device info, so all fields default to 0.

Fixes: 6c53694fb222 ("Input: synaptics - split device info into a separate structure")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/synaptics.c

index 131df9d3660f0e4866b9ffc849ca0d6ce1d4e906..4f97970abc947672ec5318c5ce2c4a2e17b430f2 100644 (file)
@@ -397,6 +397,8 @@ static int synaptics_query_hardware(struct psmouse *psmouse,
 {
        int error;
 
+       memset(info, 0, sizeof(*info));
+
        error = synaptics_identify(psmouse, info);
        if (error)
                return error;