Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp163589pxx; Wed, 28 Oct 2020 01:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjVxfRh1bTSxRTvPAp2Dswao+73a+hmYjnQU0VmVUUJvfDnFMZKZgkUxOM2f7StmchX5Jw X-Received: by 2002:a17:906:da1d:: with SMTP id fi29mr6401932ejb.160.1603872873925; Wed, 28 Oct 2020 01:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872873; cv=none; d=google.com; s=arc-20160816; b=yoiSyI8w6N363hRm7xC6291RsHy4slZbUMNfPLbd+LUS7gPXkK7/Gq6geanNBIh6bH 7kOU0xOC8vBI1E95/6T1pIuS6XrWKHhibUNfmrJX4rJpThYvuvG9XJEuvCXfz97CrKL2 IPN+n2UBgeUKUxnwbw9zSaE/V3N1c+lNgq3o+ypdyQRNpSMXVItb3PFDsErc9LbrsKe0 9R+MavV9jheN+FW4n032RucDo9Dpx4uY+kSfFAPOq9ikaYtX7Whri02o8R50c6CjZ+rO eVEWkrAH2Z6HdrmkbGQgob9TuHFsTP5jJn7WNIutNA9ugUDNRFt2qViZBuo/qpl32Z/U PYng== 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=kOX/MY6yooo+JXhchO3QrKPm/t0y5i3UwtdHad3MGMw=; b=yFPoLlMVfFwFqKdiCvjfs88OdTfFgqeXGZi+yDNtcKC0YRNHoh3TiXdeg4zXwoQfBy ms8Zga4kFw0IareNnWIK6p3AHyK23CMpFMtlckLw4eA5qBuiZMF9Za2/KpHZGn5HoT6Q 9J++4ivkbJ2xKKXaYYs4syx8zYtvPMVQNG88RhkBut4gFF9zoRRz+WibR9j66yIKpuUA GdPd3b0d/r5dMyNn/WWFCSril+C38/kl8Z9ASXmLD0l7K4DNmQhHjiW0LZDMiImWPT7+ ica/hxmxgViU2v4o+hoPkuHYPeHZgh7ZbljuiLzdB2Jsuw9k5tEDxsMjOIYpSIxq2f0q YqNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T2Oh9Q+9; 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 l12si2820211edk.163.2020.10.28.01.14.11; Wed, 28 Oct 2020 01:14:33 -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=T2Oh9Q+9; 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 S2410599AbgJ0OAq (ORCPT + 99 others); Tue, 27 Oct 2020 10:00:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408417AbgJ0N7q (ORCPT ); Tue, 27 Oct 2020 09:59:46 -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 3B1E821D42; Tue, 27 Oct 2020 13:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807184; bh=jjS6gpwBsMOgk9XdqvV8I2tubcL3s4WxOtrB5dDK+3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T2Oh9Q+9EfGvWoT9cfO0x61WRV8nAKpOOPj+lvOUj9re49Mt1LOu+IMTL0B5ncnCR gKugnaKk2/5VStOrVb86WnHnxXfm35w5OvMsJ733lbxR3NZf2OFMwgjo/GRCFJ7Mpg VkcAIgGz8Y7vD8CALmA9ZLNQZPWhnOVMoQr37fT8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 4.4 074/112] memory: fsl-corenet-cf: Fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:49:44 +0100 Message-Id: <20201027134904.055083893@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 662d050243bec..2fbf8d09af36b 100644 --- a/drivers/memory/fsl-corenet-cf.c +++ b/drivers/memory/fsl-corenet-cf.c @@ -215,10 +215,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