Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp468329pxx; Wed, 28 Oct 2020 09:02:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGWEJC461nzx8bXADqFdjV5OWwzVjsWGiQQzV9EGuPBfwqaReA4N1/z0i9AcdSAEKUO2bQ X-Received: by 2002:a05:651c:1311:: with SMTP id u17mr1056417lja.177.1603900938670; Wed, 28 Oct 2020 09:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603900938; cv=none; d=google.com; s=arc-20160816; b=qecj1mTiPz+McHa1+ZBE1OcPV2cFDAehP3Cxbx2OF9GDTJJv31vF6t6BLxz02c1tgB QUCpmvOtA9f4F6kAjAo88pNfhygzBRVuHOXaqatOhqpqMyZrzi8SbvJXtdEpuwOPwrEx GPZUQptrXE0oE53dmBr9PKTUv6vIo5/WfttYdjNjhLVi7hNVC7H0RHEaoIjfJ323XYsZ /DlKrO5O4VRNDOW5ZT6eRAzqY4+xlBAAdkhg8BbtGPDR0LDyK4PsxD8l7qA77BVDqMAD VQbYtYH0S6FF4sqigjxUkt5K7s59FfC3BD7ncuLuXBv48eUJwAgb5scmfGSbE4IAbCGw DKNA== 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=ixTLZecknFH0Srtzmyk3BYE0u91HbLQZPsl2w5KtHyA=; b=YIM8oaWoEdzkPKUJiJiAwZuDeRDEhrt2pcOq2zknAyM0KqZhd/O6ZjUIayG//ce32r u49PCZ8bAVaR1kEwKv0GDLlp1n/40FFr8fe4mz0fpAocmWKeJ1ib93t12rNUNQ7sz/6g Ajsy1ZmEHn9VUO+EvCA7Dom/gtE5E1QRyAWm7BhNrS0HLA887n/osOToP7MZkklxxecl xQFEIl972X8DVbyziL6ZWUhHuJ8YBejiDJSwEEI1d5sjGAL5rKD309zqOHC1/cA5rSma XmodJAgmsEnP7Y+4HeZbwFbY24MFvYk3MZ7ZEO3I733HYaScOK7z9Nc0/1hI0FpAnd9E ZjSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Xlkf5L6V; 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.09.01.52; Wed, 28 Oct 2020 09:02:18 -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=Xlkf5L6V; 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 S1814613AbgJ0Q5x (ORCPT + 99 others); Tue, 27 Oct 2020 12:57:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:46152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794197AbgJ0PK2 (ORCPT ); Tue, 27 Oct 2020 11:10: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 EAB8421D24; Tue, 27 Oct 2020 15:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811428; bh=2jJ9tJ8ThV/zRKfrX0CrGAv50pYCDmtRCr4Mv/+VSW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xlkf5L6VL2APw9YStQ4O4CbGsYPoyLB+JCbytq9JOnLrqwK0hujf3hR3khaAFu2HZ Y5x8IotD3ZWlCpUoFSqFAFi9A4B6Z6LLsb5nCO0ln84aBkk55aUH5FwXNKVb95O02z cx6JhCTsUIyP5jayN16aNK6pDEq0WIog7vyvNIkk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.8 490/633] memory: fsl-corenet-cf: Fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:53:53 +0100 Message-Id: <20201027135545.723344625@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 dd85345abca60a8916617e8d75c0f9ce334336dd ] platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: 54afbec0d57f ("memory: Freescale CoreNet Coherency Fabric error reporting driver") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20200827073315.29351-1-krzk@kernel.org Signed-off-by: Sasha Levin --- drivers/memory/fsl-corenet-cf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memory/fsl-corenet-cf.c b/drivers/memory/fsl-corenet-cf.c index 0b0ed72016da8..0309bd5a18008 100644 --- a/drivers/memory/fsl-corenet-cf.c +++ b/drivers/memory/fsl-corenet-cf.c @@ -211,10 +211,8 @@ static int ccf_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, ccf); irq = platform_get_irq(pdev, 0); - if (!irq) { - dev_err(&pdev->dev, "%s: no irq\n", __func__); - return -ENXIO; - } + if (irq < 0) + return irq; ret = devm_request_irq(&pdev->dev, irq, ccf_irq, 0, pdev->name, ccf); if (ret) { -- 2.25.1