Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp286799pxx; Wed, 28 Oct 2020 05:04:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy23rki1MSm8M5D7XZWrgxCB7DAXEaTpwjtU71EpdO2JPj8BJAPiP6wxDQsU3QIT/ApepwZ X-Received: by 2002:a17:906:911:: with SMTP id i17mr7087410ejd.40.1603886660371; Wed, 28 Oct 2020 05:04:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603886660; cv=none; d=google.com; s=arc-20160816; b=Sp+cbnyI9n4mUWr/dBnVeSOZADtuy/d4XNYLiz9CGSmaC+Kfsd0f++ZU8zqPyPVDLt 1G5+aXwIvh42s2rRRxLEFzwv8lROOnuBqsoMaFupgybRo99SrD3IyGBUyEFcROw4KJgz GcI66KvXEjSXoVvofez7VoziXe1ftNhcXcLcnL7DC9/PvwSp5Fa5IXB98HeFRc7vxMY+ hXkceuXSqfAHbWd+P5Qbp7c25FdeQRmdzXcJIpEuAikGjtA08km4dfrzP90XUQsR2mwJ jb4RR49DHr+ndUldFiJjPKsLBNbeJVpFctGn7VeA70oe22vCkAQbgGUBiMsUCU+lR61X gDMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rP9jYkMLl5r4fUqDKhVIUTXjycKhi4wolU+cFb710iU=; b=mjqHybGNYtpNMUmORbyW8PyhB9ekGGhzu6WwbWbj42la79mVrrCYnGvOWOlezkOK0U Swt7rQq1E7wRBNIwIwMs3YTxGQODmL/IlOw57Y22zmUHkpGwLJaUmv9UrWU4+4FqOpe2 nlSVmefW40R7vF6E243zcUMtIl9mkFUxIj+drUKO5OKEX/cQodQ80Enym0i3XzuHq3kb vpLFDTdtxvXYJlG1iZ/5xx1X7D6uM29WaCMvcwsYZSTKICH1Cg6oIbEWkQzG7k6QQNRq vxeK/oSqe91qD4QgSb+Uw7MU6CF4jDodwqz3wMj4NKW08yoKZvPOpWsEe8jwBQ819dWw +9Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fWrjGjcv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si2953320edn.245.2020.10.28.05.03.51; Wed, 28 Oct 2020 05:04:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fWrjGjcv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1795109AbgJ0PPF (ORCPT + 99 others); Tue, 27 Oct 2020 11:15:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:45150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1790937AbgJ0PJl (ORCPT ); Tue, 27 Oct 2020 11:09:41 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 CCBB320657; Tue, 27 Oct 2020 15:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811380; bh=/Q/9iT+3FZb1HMWnOjk1ncX0c8Kd3NeK+6M3GkbPHmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWrjGjcvQ/22/MJjAmQdSLpf2pehFsxYmlKF6d+h4X2Ff3wufTxNpOeivTps+dMPz HClBqj4MODAmvs/pajku+f0sgJi1bBLGm2UCoeLM9YL0A/TxzHG0m7OB1g6R6zziyb SnDRAXnC8lYFTcPAI+jU+9OCCwxryZfnhow4nU8o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Chen-Yu Tsai , Dmitry Torokhov , Sasha Levin Subject: [PATCH 5.8 472/633] Input: sun4i-ps2 - fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:53:35 +0100 Message-Id: <20201027135544.878062481@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit cafb3abea6136e59ea534004e5773361e196bb94 ] platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: e443631d20f5 ("Input: serio - add support for Alwinner A10/A20 PS/2 controller") Signed-off-by: Krzysztof Kozlowski Acked-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20200828145744.3636-4-krzk@kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/serio/sun4i-ps2.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c index a681a2c04e399..f15ed3dcdb9b2 100644 --- a/drivers/input/serio/sun4i-ps2.c +++ b/drivers/input/serio/sun4i-ps2.c @@ -211,7 +211,6 @@ static int sun4i_ps2_probe(struct platform_device *pdev) struct sun4i_ps2data *drvdata; struct serio *serio; struct device *dev = &pdev->dev; - unsigned int irq; int error; drvdata = kzalloc(sizeof(struct sun4i_ps2data), GFP_KERNEL); @@ -264,14 +263,12 @@ static int sun4i_ps2_probe(struct platform_device *pdev) writel(0, drvdata->reg_base + PS2_REG_GCTL); /* Get IRQ for the device */ - irq = platform_get_irq(pdev, 0); - if (!irq) { - dev_err(dev, "no IRQ found\n"); - error = -ENXIO; + drvdata->irq = platform_get_irq(pdev, 0); + if (drvdata->irq < 0) { + error = drvdata->irq; goto err_disable_clk; } - drvdata->irq = irq; drvdata->serio = serio; drvdata->dev = dev; -- 2.25.1