From: Dmitry Torokhov Date: Wed, 17 Oct 2018 00:07:35 +0000 (-0700) Subject: Input: synaptics - avoid using uninitialized variable when probing X-Git-Tag: v5.4~3^2~78^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f39f8688888ae74fa8deae2d01289b69b4727394;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Peter Hutterer Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 55d3350..5e85f3c 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) int synaptics_detect(struct psmouse *psmouse, bool set_properties) { struct ps2dev *ps2dev = &psmouse->ps2dev; - u8 param[4]; - - param[0] = 0; + u8 param[4] = { 0 }; ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES); ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);