aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2018-10-16 20:07:35 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-10-19 13:40:12 -0400
commitf39f8688888ae74fa8deae2d01289b69b4727394 (patch)
tree845038a024908852df633f70f6f0cc1d04ece2f9 /drivers/input
parent9023705192242a77f05c1647b9f0c6b55c955ecf (diff)
Input: synaptics - avoid using uninitialized variable when probing
synaptics_detect() does not check whether sending commands to the device succeeds and instead relies on getting unique data from the device. Let's make sure we seed entire buffer with zeroes to make sure we will not use garbage on stack that just happen to be 0x47. Reported-by: syzbot+13cb3b01d0784e4ffc3f@syzkaller.appspotmail.com Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/synaptics.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 55d33500d55e..5e85f3cca867 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -99,9 +99,7 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, u8 mode)
99int synaptics_detect(struct psmouse *psmouse, bool set_properties) 99int synaptics_detect(struct psmouse *psmouse, bool set_properties)
100{ 100{
101 struct ps2dev *ps2dev = &psmouse->ps2dev; 101 struct ps2dev *ps2dev = &psmouse->ps2dev;
102 u8 param[4]; 102 u8 param[4] = { 0 };
103
104 param[0] = 0;
105 103
106 ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES); 104 ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
107 ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES); 105 ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);