Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp233545pxx; Wed, 28 Oct 2020 03:37:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe79grbr6IZLn94B7TEHwvKm1ezqSExH7TOTmHF6PbqNdjyeUtZlxCb3k40vyuV89oeDJT X-Received: by 2002:a05:6402:890:: with SMTP id e16mr6906351edy.272.1603881423352; Wed, 28 Oct 2020 03:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603881423; cv=none; d=google.com; s=arc-20160816; b=i1RMfhG1XlICx+w/Cy9rUf/2zroegGerh60d8sTkq+gJsSiqzJ3m/lF3jUFakfEKkt Lt3T6iFNUW5U0fTQ8/Cg+00AQ9W759PnKtVv4PrGS5NPs7NjJWgB/sSOtPHkeK5CsETF DiH8H2B3zWTOucL35jyTxFCiZtO8tmXeLLwIYXODb8KFvdf6Bfsbb2ScbpdwfSLVs75e bPiKENbBvvJQ2FAMbdwsGIv+iqXFvUtkDnb3qDcafIeI4UdWLpgFdkHboNSvhOxt/Hec W02cDA28h2LTLSruod92t7UubM3zL4hmuNOYM0EwMoP5Jd7nF4xjqxOfHwwOVQl2bwXJ p9hQ== 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=A/mV7eBeyrsVFyoEMr0vVw4c8yy6Ncg6mrWtyT6Ied5mFqmo6iqeFmbdLweSFBzuqO um4BUVLqG4leRTOIKCHxM7i5+fFzAUrWYzJaP0rsAX6/5c+Xv1xUsva8oCwfgFPHoWzz c6FpTbFRH4ednaKP7tiwT0wl7gmnKyZzZeJeMAoSSoqkO9mqgea8UskoHsKrGi4vOYMa Rb6fJy3GgAjyEssOFv9p6/YiNGSUZd4VKQYOl8O46io0uPZXO/rQJqkMSG1DpGFGJ1bg EuXxRbY8I2pL58nLrAgWSVTzIu7Om405hyU+8Ru2kbEiMxgQu8MC5sCmYVJAW+syTphs +U7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UvbaQO7W; 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 dk22si2709939edb.258.2020.10.28.03.36.40; Wed, 28 Oct 2020 03:37:03 -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=UvbaQO7W; 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 S2899688AbgJ0OoH (ORCPT + 99 others); Tue, 27 Oct 2020 10:44:07 -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 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