Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp233673pxx; Wed, 28 Oct 2020 03:37:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhrdEctZ5ZZrboeZhYtPUhCpZ3Bk6C1G1R6mbOGRp4P1W4IiaFAByKLdB1I5JX/1hC73Hv X-Received: by 2002:a17:906:3cc:: with SMTP id c12mr6721015eja.216.1603881436597; Wed, 28 Oct 2020 03:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603881436; cv=none; d=google.com; s=arc-20160816; b=AwpZkTbGD9QkLn4+QzjymmUy5TwP/uBLlxvzkAvxefqu3l6KEVRvft/5KLpGhPCxhi KDXMRFKTiGo/lLVACn/YsBrCYqFvSjHBNroSHNXQJYi186tqQNpp4TXx9YsbHSxIkTHX hxgczy1G8bF5bfLU522V0ifwQqHvUD7K+4rwWEnKlyoNXnTk/tYECGOfKFFECKbDQpuf GjOXdiucQmrQ/Rrd/OBv2+vwWHRs3RxMb46q9Ny70mh8ZrVjIK1R8L29maW0OWTjmXYv JEvMR0IcfaHERfJoXEi3DPEGzTT2QMxeQEDm+5rjXck9xy79znpnZomrRAnc7dEgaIW/ 4ITg== 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=u8g9uxiVkVaiDf9fIrhHlGfuK8xntpvu4uXLkEX7OJHoMFMi/eKysYA8HAgalZqUMO QdMWPdwZXtFVdpuAmeACf4tpV0caIlfyrQ/Kp2jtQXEkenwv0BVeeaQhZvPBrTvNTS4/ TxIfW66BFk/S0+kmYkJnSo1szJieDK53eZS4x0NjM7hDsm8vyM85qEr+RVNQvUfSA1Zw BclK3IuQVp+wu7uPqp/XGJCopKfVsQ2IcIktywTj0SmH8S0Yud+wXZUIsSbcTRXjRaWF BMYlwy5UMH+MWm1qhsnqNRA7EoY2jRnjLQ/nY8+hqTE+fGXn9QIGi1aNpqGjbGT84UNB 2oZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TQLNbmYA; 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 p19si2741759edu.169.2020.10.28.03.36.54; Wed, 28 Oct 2020 03:37:16 -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=TQLNbmYA; 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 S1762650AbgJ0Onw (ORCPT + 99 others); Tue, 27 Oct 2020 10:43:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:41076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762258AbgJ0Olk (ORCPT ); Tue, 27 Oct 2020 10:41:40 -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 2E5F7206B2; Tue, 27 Oct 2020 14:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809699; bh=/Q/9iT+3FZb1HMWnOjk1ncX0c8Kd3NeK+6M3GkbPHmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TQLNbmYAspLy6wf74119YaUYZx0LusWFgbkxlJdzr/eiL6KzG7pVobnxknq2FP1Q1 0gHSAk69Z8ei5jMVAsrOeXlmVpF2bdvvqUH9zahZK2TjHKbLrVrI7fCAtnBj1rSCKf JwPcpADpkUTGEM+CnECquCigzNJMz4RVhU7jN+M8= 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.4 289/408] Input: sun4i-ps2 - fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:53:47 +0100 Message-Id: <20201027135508.451018771@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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