Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp580677img; Fri, 22 Mar 2019 04:28:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDz9xDSvXkmf11KKc1bsSG90rBX/UfUu3VAuFwANj9emVAPCELDaKwHDpYYYY6pOIQJXLU X-Received: by 2002:a17:902:2ec1:: with SMTP id r59mr8881716plb.171.1553254136988; Fri, 22 Mar 2019 04:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553254136; cv=none; d=google.com; s=arc-20160816; b=AXL11aQztJsdgtss8Aj2HjQMB02Cg+JGFN12Vm8SbTO5nC7EGo/05VJcfrKBIRU70a zGvoJvv9vYJEjIRD6995cpPJSshuNPJ6C4XeRyfVCP6eDQUS6sUKrvXHohVVSAX8zU9o BHvuYUm1fTiW9i+htZPwmMVS5vNTMZaUd2EvHe8NapGb3r612BM8kZ754MZjqyYzrv87 /WySvnfZCR24a1Ps7+SR+eOLOrB9T304mLprQFCfu6VAAjvpsY+gdNY59hOMm57bUq+E 8IccQZ2/FnzGqz/I6VO2eHTZR6BOOiXSVuY23ki30twCetCzdijiP6V20YihNYouOReZ +tug== 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=2SrI5cUMF3QByl5Lh4Xz8G8F45X9krPfkrNzRFA+Qcs=; b=cYOKK750V+2fOHRLNZ6O/tWx1xv8sowppyl45WkGhUNcCsdfUVx/diw1KqndgkRtQO rQpyuCHmup9GErr/mudQlhVbpIlzNXc9c4I/AZh1xpaBnDpCAbRLNBoQPFxjoU6eMfKc 7lWgucHWsVunGhPkLCnbkPB9m3lwc9AbTOnpbo6B8m4DZcG5MyNsxv3rf4cgQ7AkBhvN TKIwF/x0aZNqLhdw6F4USuhLglC2AVsF7fF6kBoboXQh660rd2O06Em8hnNNWGEq8NGH ZSUgWBsSl6VpxUdEQ1+JIgw+JC2Nev4cDlYtraDNyVkihPN/2G4It+sxif9gMOuyzozR 9QYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BPGLdxpi; 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 q20si6543133pgi.499.2019.03.22.04.28.39; Fri, 22 Mar 2019 04:28:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=BPGLdxpi; 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 S1729327AbfCVLZo (ORCPT + 99 others); Fri, 22 Mar 2019 07:25:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:53190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728241AbfCVLZm (ORCPT ); Fri, 22 Mar 2019 07:25:42 -0400 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 DF75A21B1A; Fri, 22 Mar 2019 11:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253941; bh=/WdgL0K6RLWu9lh35MhPit1NBdlmFMc6TuF38/aDf+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BPGLdxpihXuD5ZYpfyT+G3s7VLlVOfHFe5MBMOGEYAv0lzkdPX5DxIuOQrZU7J4vX JvJ8znApvmfmcutiOa4SahsuB4sHCl1qwTFVQ9Mm/YW7gZAoUkVrRSXtCXLkA40FYQ C9TR/naaw2+SACcYGn+99noAbmz3XiciM83m65pI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Gabriel Fernandez , Dmitry Torokhov , Sasha Levin Subject: [PATCH 3.18 101/134] Input: st-keyscan - fix potential zalloc NULL dereference Date: Fri, 22 Mar 2019 12:15:14 +0100 Message-Id: <20190322111217.468219660@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 2439d37e1bf8a34d437573c086572abe0f3f1b15 ] This patch fixes the following static checker warning: drivers/input/keyboard/st-keyscan.c:156 keyscan_probe() error: potential zalloc NULL dereference: 'keypad_data->input_dev' Reported-by: Dan Carpenter Signed-off-by: Gabriel Fernandez Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/keyboard/st-keyscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c index de7be4f03d91..ebf9f643d910 100644 --- a/drivers/input/keyboard/st-keyscan.c +++ b/drivers/input/keyboard/st-keyscan.c @@ -153,6 +153,8 @@ static int keyscan_probe(struct platform_device *pdev) input_dev->id.bustype = BUS_HOST; + keypad_data->input_dev = input_dev; + error = keypad_matrix_key_parse_dt(keypad_data); if (error) return error; @@ -168,8 +170,6 @@ static int keyscan_probe(struct platform_device *pdev) input_set_drvdata(input_dev, keypad_data); - keypad_data->input_dev = input_dev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); keypad_data->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(keypad_data->base)) -- 2.19.1