Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp596576img; Fri, 22 Mar 2019 04:50:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxh+oRpMKIZXYvT7FeiyTXpR7QjmWf8pvLuGMqMSh4ztS3pqmniQ+7DHLvxKXj15LVC8gL4 X-Received: by 2002:a17:902:aa92:: with SMTP id d18mr8738753plr.278.1553255443519; Fri, 22 Mar 2019 04:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553255443; cv=none; d=google.com; s=arc-20160816; b=RBAJhGXgoNJWE720nW19SQJ0vNFwueOqlYAn3/W9HD6nCkT83TLh6JQkq73VM5uo4A 2tuuH9k8Fi3LIqD/vwjBKPXH+knY39t8s+ztcMmQN0SjHqFfwQElK76+XEHBcAUri/i4 aVmqN0SLjIDemkPctzB7oQ+JqO+tMtnXRqilxV2Nb4whDYJFQbh28qdV4Sgzb4udQUlH 7WE3yWDCGY0yE8r0wkrJU01HekS8U4NoueTsp5vx6bh/c7bJ3WEDwU2avqoGkS3/Kd/K 6njT7rSBNjSbo3NGAC0Mf0mrQ3yoZdmau1Z56uAdI4MkiVm7dbZr39eYF4dJBelC3QAk A5EQ== 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=+ubTZ5Ny1Uvx+ykxKz2Ge/V3sddoO07c3+sciVHvIW0=; b=dgX+A8GjGzdUpsmo/QMSYNYuVzItbLcUiBcgkmOfxpAS5zS71T/4Ru390616PbNPdr HsM9CZ7hrgAOocdl5HDFdEPCe2pt++eN4EVkI6MecGqB6arJOoAe6U9otM3HIRJczSmm QAWQjN6S94ONrtd0w6i+r1e0Rep7wYkXxoigjVKRpFPF0xZ4IwN3O9ex+xBqObvJKpdR eW5RMVZMuiBw270alipQKZPLctVVVvoPJaeN/Dnn1671lPDqvYW9KFJnz6OMKoDsf7QO /t+OwMm/vVzzIUh/J59FtULM2HaToX0xbxs10k6L0HCXkNfkcZ4RnCV2iJ8+hRajp1a2 kXAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sd+a5TN3; 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 p2si6242440pfd.257.2019.03.22.04.50.28; Fri, 22 Mar 2019 04:50:43 -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=Sd+a5TN3; 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 S1732338AbfCVLsp (ORCPT + 99 others); Fri, 22 Mar 2019 07:48:45 -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