Skip to content

Commit f39f868

Browse files
committed
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: [email protected] Reviewed-by: Benjamin Tissoires <[email protected]> Reviewed-by: Peter Hutterer <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 9023705 commit f39f868

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/input/mouse/synaptics.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, u8 mode)
9999
int synaptics_detect(struct psmouse *psmouse, bool set_properties)
100100
{
101101
struct ps2dev *ps2dev = &psmouse->ps2dev;
102-
u8 param[4];
103-
104-
param[0] = 0;
102+
u8 param[4] = { 0 };
105103

106104
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
107105
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);

0 commit comments

Comments
 (0)