From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751032AbdE3DQ7 (ORCPT ); Mon, 29 May 2017 23:16:59 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:36273 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbdE3DQ6 (ORCPT ); Mon, 29 May 2017 23:16:58 -0400 Date: Mon, 29 May 2017 20:16:54 -0700 From: Dmitry Torokhov To: Eric Biggers Cc: linux-input@vger.kernel.org, Benjamin Tissoires , linux-kernel@vger.kernel.org, Eric Biggers Subject: Re: [PATCH] Input: synaptics - clear device info before filling in Message-ID: <20170530031654.GE32841@dtor-ws> References: <20170529052707.2144-1-ebiggers3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170529052707.2144-1-ebiggers3@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 28, 2017 at 10:27:07PM -0700, Eric Biggers wrote: > From: Eric Biggers > > 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 Applied, thank you. > --- > 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 > -- Dmitry