linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: synaptics - clear device info before filling in
@ 2017-05-29  5:27 Eric Biggers
  2017-05-30  3:16 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2017-05-29  5:27 UTC (permalink / raw)
  To: linux-input
  Cc: Dmitry Torokhov, Benjamin Tissoires, linux-kernel, Eric Biggers

From: Eric Biggers <ebiggers@google.com>

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")
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 drivers/input/mouse/synaptics.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 131df9d3660f..4f97970abc94 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -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;
-- 
2.13.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-30  3:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-29  5:27 [PATCH] Input: synaptics - clear device info before filling in Eric Biggers
2017-05-30  3:16 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).