Skip to content

Commit

Permalink
Input: synaptics - avoid using uninitialized variable when probing
Browse files Browse the repository at this point in the history
commit f39f868 upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
dtor authored and gregkh committed Dec 1, 2018
1 parent 9520db1 commit 922fad6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/input/mouse/synaptics.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 922fad6

Please sign in to comment.