Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp163267pxx; Wed, 28 Oct 2020 01:13:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9bQLrB7zJAUzKhsZWXFQK1mIIwUJeQYTvrWsASOn/czAKJGQRsqXmN6d95qyL3tehLPnj X-Received: by 2002:a17:907:43c3:: with SMTP id i3mr5948966ejs.231.1603872827387; Wed, 28 Oct 2020 01:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872827; cv=none; d=google.com; s=arc-20160816; b=X1CMgJ4TYvtfvP8ZBG53KgRqeCSxmir9hLfcTlrlF7wFTlAWtkMxW3azmHY8Ogf7zW W4s3FGSBMgjY1nPD9vc9v4oZTa81mBWgjdHYARuauQiJSkFfp3KkgAjrjE6Q5cfP+iYh O7/cNuKQ7TQCDEOHalkBRt/54wVJeWr9UQ1uDt8dkfMc1YTGxIQTD0kLU9H5EvbvOEh9 gw/5tUwi/iAvLZ/S9wVFOMndFXu5BJhc3kwhV9Hf0mTRsBtgmf76qllumTpGLBcs1j/D 9+7kOhiCk4Xn84jT/UgyRXp53azD+WZfwfBbjrfJ7qqJEKjvh0jmoM8Fn6tUzrAyjKef xBgQ== 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=w8rgRucvL7GLMiYhHehZeMpPMPafnusv/wyYT4XzKYghZUb1DkPwoPvjJ7xoWIvGTG lNQQQ9hGiZPfgi7pJJa05+FCT2B576cSMS7HMpDv+tCj1EPC2idxrBCtWkK8pnzKnePi wh/0sUdkJZpFmVRagooh22HVGSWZfFglXbOBGYfc74iVPN0m8/xJ8qkPOp+7kWjKfi7F 5UivcgJPHaQl3ibgl+t7tnHeTFxzcTy9iJHBcaZfOcDT/GAfumA23eHqykCFxUQ0zzWo O+UqCvKHMyn15QNh+E3bWyBePGZIDvBWut/u0fxDoHA3BrSPkVKgJnZsgi8XDpyQw1Qz f4XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DWQ1nLET; 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 b6si3402013edu.343.2020.10.28.01.13.25; Wed, 28 Oct 2020 01:13:47 -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=DWQ1nLET; 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 S2394537AbgJ0OAg (ORCPT + 99 others); Tue, 27 Oct 2020 10:00:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:47120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2411495AbgJ0N7h (ORCPT ); Tue, 27 Oct 2020 09:59:37 -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 DB7112068D; Tue, 27 Oct 2020 13:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807176; bh=hR6U4WnyyHaew0oR5qjCvxwyrsc/wpr+fungtJa7tUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DWQ1nLET5kcWfGFkjXhOgCiz5nvG6ENrhuSmI1h9H+TGE9afUmCMQWKT5furSOcCS a1uRls9JQgPvelBaPFiyGj6Ys+mZ/g7cOD+Kk30p5c6qpBlYGHTOgXSmK2Ecq50aUb 9n9JyQkjG6+bwTrtV8daaKWNeHJqFh6Z0JeWLFbk= 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.4 071/112] Input: sun4i-ps2 - fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:49:41 +0100 Message-Id: <20201027134903.919299472@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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