From patchwork Mon May 29 05:27:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9752715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68686602CC for ; Mon, 29 May 2017 05:30:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5910027968 for ; Mon, 29 May 2017 05:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D4EF27F8C; Mon, 29 May 2017 05:30:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E436827968 for ; Mon, 29 May 2017 05:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750879AbdE2FaM (ORCPT ); Mon, 29 May 2017 01:30:12 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33014 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbdE2FaM (ORCPT ); Mon, 29 May 2017 01:30:12 -0400 Received: by mail-pg0-f65.google.com with SMTP id s62so5329053pgc.0; Sun, 28 May 2017 22:30:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=awiRFfNBu+GSBEqsf1q9/JGu+3n8x9sSSw8BbTGDTCk=; b=Xg7aFLPTk1sBLwkZCDemEJWaaoDGL/QFxJrVmFYPGEYGFjTkTH4UWMMBgV74feoqnI FgPHpa1jImFT3OOHiE/njEvUTkINPaCQOjcqq1ToIZ4o2YCLiUOGnHwLXyWL62u5944O lvHF/QW42s7Wa5M05LvgGyeWvbwBlUK1jQYjVUxKOhR7JHiEzKqsvm4LKjWBVb2yIgsk e+KvAdjcHNqvIsLOGeQ+DLeoljv4RUMqab+NlQUmDo1frenqtqUHwWARNusFWnIk7Xti eca8+hbcDdTD1xmZ+mMhkPBRu7ccRmgW8F1fXrFPr/XQOJsMgtvG4C73jL6pJsoO7/bI td3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=awiRFfNBu+GSBEqsf1q9/JGu+3n8x9sSSw8BbTGDTCk=; b=o3R11poRSm1PYcKqTjNfPu5ZcrJo5Bg+cQPmYIJzqDnM0umVPypFzCsfUaHwb8K/uF cPXXcsdfIX3JhDiLameBv0fEYS/hvV83yFusr8wt+paFJb/4byQTHClx4UonMDq0/EQP jDtyrUXrYc0Cy3z2DpQvBKDo1fE/jXouDzEZeUBs5bjEQaK9BM9bQ40t7oONqySyGxw0 azOJsLSNKVBULono774GHWi6ozGTzw+eEwscPnSA9pxTp/2pMUzoFHlEA0Qcoj5S8MFB QcYL1YkBf3LYkEPtHOWOmzt4DUuJLVUQovbnJc0e54QvikL2dICffDChmhrKbtCkwLJr Noyw== X-Gm-Message-State: AODbwcC23ENesUXUqOxKSUOLMyxtKzzx6434w3EwRaJ1YeaCowy5227+ fl752wlZTy5gP9UAxm4= X-Received: by 10.99.62.11 with SMTP id l11mr16695531pga.238.1496035810937; Sun, 28 May 2017 22:30:10 -0700 (PDT) Received: from localhost.localdomain (c-73-239-167-150.hsd1.wa.comcast.net. [73.239.167.150]) by smtp.gmail.com with ESMTPSA id 23sm14535315pfr.127.2017.05.28.22.30.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 May 2017 22:30:10 -0700 (PDT) From: Eric Biggers To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Benjamin Tissoires , linux-kernel@vger.kernel.org, Eric Biggers Subject: [PATCH] Input: synaptics - clear device info before filling in Date: Sun, 28 May 2017 22:27:07 -0700 Message-Id: <20170529052707.2144-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.13.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;