Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp171742pxx; Wed, 28 Oct 2020 01:31:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeTtKYLI+7ERD3G03wgwnhyEp1dAHXTrIAB9qumUV+p5VLAYTgkCmd1HOGEtcZK/mV/1zk X-Received: by 2002:aa7:c490:: with SMTP id m16mr6465397edq.298.1603873895246; Wed, 28 Oct 2020 01:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603873895; cv=none; d=google.com; s=arc-20160816; b=rCkcxE9bkTa95rEhrtV1EPECqZ11QVd0NHQzIbSb+tMKzVO4Oxip8PaoSefcAOv5XQ NeRNCUJdPvp3GXat6F/rZ8ViqxV1GK1tnScTwT3kr7lJNxN5gvFm+65o/B181/RfwC6d THxC+RVB53iC36/kiCKYXbM1svwvNcJG28aAhZWleN75VXzlvJRl/AGYcZk0tGbIfvwZ 6zscW6PyapFrXgt+fSVBmf+5FYwRBaZKToTNo6unm1cDLS77I7d4F2mCTBPTgbUt6s0m 6Mnz51PzM4bdEN/b7J+ME68Ttb/vs7Qss//gzIzdVBUooPw3woQz0rQMmmoIdu7yBxVA ZRag== 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=tJSxCZzkIsB2KaNhqtrE/YX3E/LEMLnQnGklb/tZlP4=; b=EoSDqj6cjqVWFNOEfN7lPR1y9Wr5V0bjgSbRB6uwWuR3Kyy53QCTbwTzAnCN4q4DP1 AGaruMxRl3m8xa8s9E12D0YLKXkIPjCKDZte6uRf4yImJPpFdMWMpco+Uyarj3tDnjk1 wYpJynNXgjjdoKOwFfWk52O/wPEYwNQ5ggrIqM6wtv//Cdj668v7iMyywPa6tghZkUUm 7hvQNArQhxQhNi1kXiGSFQ/qQEXLEjdOOiZs/OxDUqcJccJ6E2Z4VnBF18PQhXYXEmTn At3XK5VVTEbI4BkpfRa3XCAwGOI3QVSvlguC46YE9mJsw01c8uTeMsvs4lxEARpiUunC 7L/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=loeLqzpG; 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 q18si2524555edb.466.2020.10.28.01.31.13; Wed, 28 Oct 2020 01:31:35 -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=loeLqzpG; 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 S1754461AbgJ0OFg (ORCPT + 99 others); Tue, 27 Oct 2020 10:05:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:53816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbgJ0OF2 (ORCPT ); Tue, 27 Oct 2020 10:05:28 -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 8D73B22263; Tue, 27 Oct 2020 14:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807528; bh=hR6U4WnyyHaew0oR5qjCvxwyrsc/wpr+fungtJa7tUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=loeLqzpG+afMcVYNnrqEwljqu1gpsvwg5J9hzKrwN3yYSgOhKNmKzGvptWiRs3wWU yZGOoK36yzlhnfn2jVlSfCNKGV6c3yC0j0rgozTelDkbWrsDALvbvCEXBzj/CpHWXD tGkpt+497QqmKMjB+toMkTgNZcEuI2p4JRq512TE= 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 4.9 085/139] Input: sun4i-ps2 - fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:49:39 +0100 Message-Id: <20201027134906.172669109@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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 04b96fe393397..46512b4d686a8 100644 --- a/drivers/input/serio/sun4i-ps2.c +++ b/drivers/input/serio/sun4i-ps2.c @@ -210,7 +210,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); @@ -263,14 +262,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