Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp172106pxx; Wed, 28 Oct 2020 01:32:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgH2l79EXGTef5HpNIRNCYo67ZxPx8Oz7aT3whYwC31onuJwU0nNmVnNYkdAz4csTnfoEz X-Received: by 2002:a17:906:3cc:: with SMTP id c12mr6341963eja.216.1603873933983; Wed, 28 Oct 2020 01:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603873933; cv=none; d=google.com; s=arc-20160816; b=WEyjrGHD/LvXegbwmfmF1sRuQ6zTLKHXKoDhyNH4Pa834cso1e0/4gwREfDF9ag/en Qao6s4v4X6EU+Ww2FdSOhcFpyYZlIKA1SHAxx+NMlGFLx228uRGgv078/n6wNHSg+etA 3A7JTuMn3CgXToF/c3qn4vomyvqgZZM/ckhz3TF5qPSQgffLMNSVD4eTGDV+Sr4xlTPJ PyC0DggJTrgn5shB50eDA0BCyXt3kBff7RCC09SP5oP4etobnq6skgfroOnT8vlAf9Cu 19QjMLVwS/KpAn7/PFhYQQFlaotsFmeZM0wmpZPumLpCsTEg/yPgDiTtcAuI9BXcQO1p k87A== 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=CfcIm90WlYZuxLNmq05hQrFbwnswS47nQuVLVBZFg/tJ3T91t2HM17HeuRPx32mTUB P3jCGs+3uat+z9x1jwTc9FndmslumxfiUmsozKMjU7TxiuXx7pj7R2yJCPqh1f0HkFDy O1uvEjBW5OiXTMRMY/wP9/uo3Gg0B3ouF9MYdx24S0jgcmn7BLc7r6krPo5imCxtCLwu pa4CA6MqQnU3Eg5MVdlKvg7ut+Zne3hCfJJiIB84nkJczZ1im4xA6KMfDlu7wkhNR+RE thi/ycUNDo2vdcqqZaQrn+Hr0lmpfn3XbzmX9PzRIDjzPfPEOSVNFVFIktHrUYHy/H9M gryg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DrWa9V2n; 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.01.31.52; Wed, 28 Oct 2020 01:32:13 -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=DrWa9V2n; 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 S1754485AbgJ0OFm (ORCPT + 99 others); Tue, 27 Oct 2020 10:05:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:53956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754440AbgJ0OFg (ORCPT ); Tue, 27 Oct 2020 10:05:36 -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 C9BB822264; Tue, 27 Oct 2020 14:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807536; bh=jjS6gpwBsMOgk9XdqvV8I2tubcL3s4WxOtrB5dDK+3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DrWa9V2n7xvrwPsibN0x8xsdmQfWSW3AAx9+YvKFe6wt7u/b6cxsCGZ4SAR36IUxV oIaN60dJn+MVJKCUaP18C/QDldKYF4pngRcT5mgG9qyL96OYYlPkbZ6xaCYu5op4h9 oFv94HNlQRFDgQbVg54RGv9hovSYfy0T+TqnYdtQ= 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.9 088/139] memory: fsl-corenet-cf: Fix handling of platform_get_irq() error Date: Tue, 27 Oct 2020 14:49:42 +0100 Message-Id: <20201027134906.309289530@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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