From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EE54C43381 for ; Fri, 22 Mar 2019 11:48:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D0A2218B0 for ; Fri, 22 Mar 2019 11:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553255327; bh=uNbDeX3/N5seONzQ/UfZGVvosYmJVPZbBa0MG+0b4Ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=nkHI6/xDJtudIDcxDiZndh/hdDhBTmKxCcAuubs/Z2FUzHArWUpcCO6q+QlVHM3Vm kveORbd9xYujP6PRAc/nKQXmzehiuy2qJxQeSNdMMO8YPvQf+VQ3VNcA+FJ1ue9PLv OX2GUt6M6BAb3GlILDhhKejaEbYZuBXUUT0M9r+o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732152AbfCVLsq (ORCPT ); Fri, 22 Mar 2019 07:48:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:52048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731629AbfCVLsn (ORCPT ); Fri, 22 Mar 2019 07:48:43 -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 126E2218B0; Fri, 22 Mar 2019 11:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553255322; bh=uNbDeX3/N5seONzQ/UfZGVvosYmJVPZbBa0MG+0b4Ds=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sd+a5TN39NGIhG2QV+ljTEw/CAG24cgi3Kp8uc0eHjERW7ZtnoZrgNu1kk8kWiAWl Q47kQRmvnhnj32bf14kpPe5iSLDf25JVwI155lRi1oRC1KJfr+rmIb9GwHImziVbpQ sKScT0g5SzzwvI6O3b11SPawsZxfnQBbyyURbwkk= 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 4.14 036/183] Input: st-keyscan - fix potential zalloc NULL dereference Date: Fri, 22 Mar 2019 12:14:24 +0100 Message-Id: <20190322111244.342294677@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111241.819468003@linuxfoundation.org> References: <20190322111241.819468003@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 4.14-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 babcfb165e4f..3b85631fde91 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