Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11786408pjo; Thu, 2 Jan 2020 14:15:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwd7emQjGLbXfWmrhLxkIooj0qSqKxYo39I4LCv+82kjxbeY5cJeG6EUqz0YXhbyk55wf9D X-Received: by 2002:a9d:2965:: with SMTP id d92mr88928211otb.175.1578003350618; Thu, 02 Jan 2020 14:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003350; cv=none; d=google.com; s=arc-20160816; b=Y8hXWWxvQfPqljUhFsfE+rQcR7S1FOdy+efL5UXHfC5xVa1It+jOhctgzBatcMSjpf MiJIF6+2hsU2Szqwuu39oLJXC+OMOYhXHS8asorlLWyrnpkIIhCbriKDTAJcxDafCYnR 2QsLTvVwaOde0Tm9H+Eft9FhKr7L8hkJR3swq+ZV8nKYY+17c/H68Au5rpNMdnAHABSl hz9yDQrjtr1vBj00FI1nkp3kadXTUepxtoSx2NgvEyNBkpVA+vzfPfqsgkeYffSd6QuX mN8Pj5YfIIea/chK0XIXcGxEO4GjoSvhmK4mV1NhyzVVu3enJwI7r2O21TzoHyUqeex0 YmDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=omj17f3j3PPG7UmsDGJtTdBgZEjDXYi0NcCdhplIHI0=; b=Yj39zR8ZmF7CxXQ73FFDrGekkEpgoPedduFVGElhQ07lx6CdVEspyLnxPgV8Y19hJw OSNhVsz6cGyfqxtJ0lCfWoGw0lV4Q6wZG0tmVKCrKtZr0mnUf7ZlI35lWjVsTaNvfNQ2 CoutboWw82PG+zcLMrsc/PAy1eiKeJTe9EQSM8gBn/8ntZArxp78ykuDBOz0VW7/X+8X qsrtRB0oBtr/gVaPZxt0mOKkl7NDeoxnz60JpClWennVShWC8SZ3EzyscI/U8CDEWPVS oDvfcFAW5L9myAViNFik3p92im6hRV9RylC2MTrr8URvya8VkqNSBenqHVXDR9FbYJn6 wfwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DHHbvCbk; 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 c7si28598151otr.308.2020.01.02.14.15.38; Thu, 02 Jan 2020 14:15:50 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=DHHbvCbk; 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 S1727528AbgABWOW (ORCPT + 99 others); Thu, 2 Jan 2020 17:14:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:54532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727361AbgABWOT (ORCPT ); Thu, 2 Jan 2020 17:14:19 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 65B6D24125; Thu, 2 Jan 2020 22:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003258; bh=YKzmLDGM+26DWt1qYfbrH6yMPu9ZkjIK/pFyMAkhQ98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DHHbvCbkQVHGCJcbPanFkJ/R8UGqI7QGH+qCh/7rNahU+Z5D474zhA4JV346+wXxR vW9GH2p/efvyjQ+JWZFmF4On9Fh8Cc9E85XIavHRat5PBy7QQOWfaSVB3bHsuBQozO kX8/1b6ZqbPoIs88MhuvPRVTHaCFGuC4sEbPR34M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Torokhov , Sasha Levin , Adam Ford , Sven Van Asbroeck Subject: [PATCH 5.4 060/191] Input: ili210x - handle errors from input_mt_init_slots() Date: Thu, 2 Jan 2020 23:05:42 +0100 Message-Id: <20200102215836.397291369@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Torokhov [ Upstream commit 43f06a4c639de8ee89fc348a9a3ecd70320a04dd ] input_mt_init_slots() may fail and we need to handle such failures. Tested-by: Adam Ford #imx6q-logicpd Tested-by: Sven Van Asbroeck # ILI2118A variant Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/touchscreen/ili210x.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index e9006407c9bc..f4ebdab06280 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -334,7 +334,12 @@ static int ili210x_i2c_probe(struct i2c_client *client, input_set_abs_params(input, ABS_MT_POSITION_X, 0, 0xffff, 0, 0); input_set_abs_params(input, ABS_MT_POSITION_Y, 0, 0xffff, 0, 0); touchscreen_parse_properties(input, true, &priv->prop); - input_mt_init_slots(input, priv->max_touches, INPUT_MT_DIRECT); + + error = input_mt_init_slots(input, priv->max_touches, INPUT_MT_DIRECT); + if (error) { + dev_err(dev, "Unable to set up slots, err: %d\n", error); + return error; + } error = devm_add_action(dev, ili210x_cancel_work, priv); if (error) -- 2.20.1