Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1225177pxx; Tue, 27 Oct 2020 11:09:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOUHmaDP8z6Z5FjVRFOtibCaYl0UewElkyCWFAMBQsVt1rDpVXW3WTjOmqGGLWDEzzMFHs X-Received: by 2002:a17:906:f185:: with SMTP id gs5mr3593885ejb.107.1603822195330; Tue, 27 Oct 2020 11:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603822195; cv=none; d=google.com; s=arc-20160816; b=iF4Yu8yDEozUZFbkuCzMegif9BNtC31JL75sJAFDUT57aIwD5fWgglc7z6bHjgl06B bGLQxPDPdiGyDX8bdGgQOlfAQcXuIydaD/nXJjLsV5y82iN+VN7uOy7+FVCP/NWWhqBr sYfWs6HReYaJ62VYowdhjIPyhOq8R/HxP+EW6Mq9DvS496c+fh8UviFG3zXb2w1AR7B9 omAdc+wSGs5wdJu0M+J6xLGi/XvHkelJ+9uGHUMX4If07yFXC36e/9ZMXB5xj1npbtPy zHK9Zh8hfCduOVo27rH3YJNBmRpG4IJ50G9fX7Smadl3OTkKRJbjQXFSYmJpmLhorH2o 1Sug== 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=K1KYZpdpFRLMWBZBvwwqjMk5I3+1TmxlUujVx5SqMLU=; b=hNopKaz3K8mzy/g6vytNHSU/psAw6u+ywfWziIrUJTVbEh+hn8Sh2Ms9/KYDaOc5B3 l/ODOh/4f/TM6E2d4WM+ClsSrU1zdkxZNR0HkgWdGaM1GsJ2TI07uN30BiVcu3e/1JCf I0nIxWuQs3fwXfGSxlbyJuGTtpzjVrQuMteFFm+47YtWocRm0V317MOO3zOavtlCykdM F07SI69LoilHKgyRZsLeX+upFhtw4UejSDTLUXP+5HHYXDzPkLyA5oi4UHgp0uGHa6CI hVV3OBDnY8lH8xwsqeNCbu3jqsPmMPG52AC2jtJo4z6hx7RUZdgnmZpIQ96YmXJJRAfv 5fKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rBhE33Pu; 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 c18si1556901edj.340.2020.10.27.11.09.32; Tue, 27 Oct 2020 11:09:55 -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=rBhE33Pu; 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 S1821373AbgJ0RnI (ORCPT + 99 others); Tue, 27 Oct 2020 13:43:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:59036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2902297AbgJ0OcL (ORCPT ); Tue, 27 Oct 2020 10:32:11 -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 6780A22264; Tue, 27 Oct 2020 14:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809130; bh=CarXUol4ius3zcQ5mRKza32zmL/tiUNWnjM1Ueti1xY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rBhE33PuDXk8FvEUzGfwsTzBq7FaRh5PTeouom/Vt3EaU3DdhcvShJvj7Z2oS+j2t DNFEqJoeu4CwBi0nUe1h8y9JheRXc8Xx7iMqDtolwLyaJlXGByyHzOwZQTuQJzXtkc u3vij+pcIgkPJIs5nIHO+1YA1iRacEKJoe1dqwJk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Borislav Petkov , Stefan Schaeckeler , Sasha Levin Subject: [PATCH 5.4 056/408] EDAC/aspeed: Fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:49:54 +0100 Message-Id: <20201027135457.663956457@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 afce6996943be265fa39240b67025cfcb1bcdfb1 ] platform_get_irq() returns a negative error number on error. In such a case, comparison to 0 would pass the check therefore check the return value properly, whether it is negative. [ bp: Massage commit message. ] Fixes: 9b7e6242ee4e ("EDAC, aspeed: Add an Aspeed AST2500 EDAC driver") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Borislav Petkov Reviewed-by: Stefan Schaeckeler Link: https://lkml.kernel.org/r/20200827070743.26628-1-krzk@kernel.org Signed-off-by: Sasha Levin --- drivers/edac/aspeed_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c index 5634437bb39d2..66669f9d690be 100644 --- a/drivers/edac/aspeed_edac.c +++ b/drivers/edac/aspeed_edac.c @@ -209,8 +209,8 @@ static int config_irq(void *ctx, struct platform_device *pdev) /* register interrupt handler */ irq = platform_get_irq(pdev, 0); dev_dbg(&pdev->dev, "got irq %d\n", irq); - if (!irq) - return -ENODEV; + if (irq < 0) + return irq; rc = devm_request_irq(&pdev->dev, irq, mcr_isr, IRQF_TRIGGER_HIGH, DRV_NAME, ctx); -- 2.25.1