From patchwork Tue Oct 27 13:54:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D9B9C388F9 for ; Tue, 27 Oct 2020 14:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6B06207BB for ; Tue, 27 Oct 2020 14:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809747; bh=2jJ9tJ8ThV/zRKfrX0CrGAv50pYCDmtRCr4Mv/+VSW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=y0wip4gbKkQaUtyThS90u8l6+TJpR5k7fanIbx9pBxccZWzi8zl2IMvJpPdDIODVh 75CIVi4NNL0uO+DTjLldo4D4rEhxcU6khFG9AFbQWzQdaQHn+n6HQYa+qiW+Ihrn62 QoFKbFsZTlLfPsKR6sxpG1N5CaENlrFA6ies+Z6E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762365AbgJ0Om0 (ORCPT ); Tue, 27 Oct 2020 10:42:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:41982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762358AbgJ0OmW (ORCPT ); Tue, 27 Oct 2020 10:42:22 -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 CDAD2206B2; Tue, 27 Oct 2020 14:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809742; bh=2jJ9tJ8ThV/zRKfrX0CrGAv50pYCDmtRCr4Mv/+VSW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UvbaQO7WUlgSMj74jkuHv0MYp4PWAUJGY9qsDvkrviaOzkOBVEdsNkOKaHz9EgoXe zcFtmm/XyW63WnF3E5SWX6g3LPGVk5dZ0kyEBGh4RvAddN5HL68nzUuKl6DmJtYytM PyswCGW8SfjBU8Cl1qJaao2oFBMH1myC9/GpXDxA= 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.4 303/408] memory: fsl-corenet-cf: Fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:54:01 +0100 Message-Id: <20201027135509.086191302@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 Precedence: bulk List-ID: X-Mailing-List: stable@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) {