Skip to contentSkip to conversation

Input: synaptics - clear device info before filling in

PATCH Applied Eric Biggers 2 participants 2 messages May 29, 2017 – May 30, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: synaptics - clear device info before filling in

From: Eric Biggers <[email protected]>

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")
---
 drivers/input/mouse/synaptics.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/mouse/synaptics.c +2 -0
index 131df9d3660f..4f97970abc94 100644
@@ -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;
Signature · 1 line
2.13.0
maintainer Applied
#1 lore raw
Quoted 11 lines · Eric Biggers

From: Eric Biggers <[email protected]>

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")

Applied, thank you.

Quoted 20 lines
---
 drivers/input/mouse/synaptics.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/mouse/synaptics.c +2 -0
index 131df9d3660f..4f97970abc94 100644
@@ -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;
Signature · 1 line
2.13.0
Signature · 1 line
Dmitry