Received: by 10.192.165.156 with SMTP id m28csp1175761imm; Wed, 11 Apr 2018 13:56:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/69gIV8V84aAdGS0WNUDh+G6527kTldwH556kNmfmSvTzix5M0IE0C038137EMqOVq/mGv X-Received: by 10.101.96.65 with SMTP id b1mr4655013pgv.340.1523480215704; Wed, 11 Apr 2018 13:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523480215; cv=none; d=google.com; s=arc-20160816; b=e5h3BAeCB3bByNtuw6E+VTirweTkVA7Rvw2rYeh3Aco0y+azA14vby3qTamcvQra0x EACCs3sgOndfnvp9K/MIvPyb5lbZ2+CGeOm41CdTgKOA3kjvXuTJHox7y5NpZ954qiWY ueZ4JOHEjmcxTsIh1S0FQyG5WJ5Zwi2qokNmeG2u0Ukxja6chQ6lNUV4Xq5QRKwiJhhI 270AKNhCr5ii7gkk/rkpi1RxcmvUbirPkCq77watHuXsj+/NtAkNeOHyFQfcbpry1iQi OxdwccE0+qKuhX+oAgTUAo79YLCMOU+sgL0Y+JLSMmIO9pd1Dm4+fczrkuiWETOwlZLm zQ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fp8w1t0xKK7Hu6S3oXq00+0ZxzqHfqAaIeg4N1J5fKc=; b=ETJTLqccvldgFr2pl6nHSy073gBHZsETg43wVDG8iDLG8NvO8CdQN6LH3u4sQYxo2u M1Z+BSEJUb5yOFlRIdCs7Ol/iyKvTReqp1R61TRVHW3HzJcjl5IfbCtl8edqTkVnvSbn gddw9LUvxNaCj7b6VO1KfLKFEt8MYMSPf7w4l2iJ/3utg+v+rstuaBjBjPLlnm1uco3G +cEIH//uErJhHfqlChmtxhyyvTt55YO9sxCNhaPNpykwO58gOl6DXkwd8KEVZ1WgZ5BZ aWKHPaZPpTF9aIA9WRfMWtRYzlk8E7Wlw9YbTtDhDv2SGjjy6dP074XVcUBdrzJ4VfEe xslA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5-v6si1750151pll.269.2018.04.11.13.56.19; Wed, 11 Apr 2018 13:56:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932391AbeDKUxg (ORCPT + 99 others); Wed, 11 Apr 2018 16:53:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58520 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755468AbeDKSpN (ORCPT ); Wed, 11 Apr 2018 14:45:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2FAD2C64; Wed, 11 Apr 2018 18:45:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Roeck , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.4 024/190] Input: elan_i2c - check if device is there before really probing Date: Wed, 11 Apr 2018 20:34:30 +0200 Message-Id: <20180411183551.563505141@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183550.114495991@linuxfoundation.org> References: <20180411183550.114495991@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Torokhov [ Upstream commit c5928551fd41b2eecdad78fa2be2a4a13ed5fde9 ] Before trying to properly initialize the touchpad and generate bunch of errors, let's first see it there is anything at the given address. If we get error, fail silently with -ENXIO. Reviewed-by: Guenter Roeck Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/elan_i2c_core.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -1082,6 +1082,13 @@ static int elan_probe(struct i2c_client return error; } + /* Make sure there is something at this address */ + error = i2c_smbus_read_byte(client); + if (error < 0) { + dev_dbg(&client->dev, "nothing at this address: %d\n", error); + return -ENXIO; + } + /* Initialize the touchpad. */ error = elan_initialize(data); if (error)