From patchwork Mon Oct 25 05:00:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 12580709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3186C433EF for ; Mon, 25 Oct 2021 04:54:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A88360ED4 for ; Mon, 25 Oct 2021 04:54:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7A88360ED4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FNky4GfeQYHZWqA4pLKyGTrdEg4Tm9RsJmYfBsjHx3c=; b=sGT3qjZDh9HTqH MQ4il06EUr7eiex+Gx4NpWyBviZINOe5ouqqeuAL0j/cby02DeO4PBLHj7rSyqqmT9fqydA7buhy+ gcqlp99rmrI3WwvOnRGyxhcKrwChZwSwqz5wGK4TBF30e7FEN/DWyKkLLxnagO3FR9Bol1aKj24sN VTyYhZ8Ul6E6t0DxuY3AAKW+gMeqNBQPcnhv3bEQDkZpMJuZRgBUdx4w6fmAVYz8TXUL+TgcHTgGj rgoIzuEAs2OyhVxiBNA5kUGEIUMNU41GwTHzC8JzZTA1J16OIzclSe49i1mw6ui4g6QT0FPKJBvut wDxgm62l3kRkZlhIomEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1merz0-00FHSb-HP; Mon, 25 Oct 2021 04:53:14 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1meryv-00FHRA-O1 for linux-arm-kernel@lists.infradead.org; Mon, 25 Oct 2021 04:53:11 +0000 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Hd2dR1j3zz90Lx; Mon, 25 Oct 2021 12:52:59 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 25 Oct 2021 12:53:00 +0800 Received: from huawei.com (10.175.103.91) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Mon, 25 Oct 2021 12:53:00 +0800 From: Yang Yingliang To: , CC: , Subject: [PATCH -next] irqchip/mchp-eic: Fix return value check in mchp_eic_init() Date: Mon, 25 Oct 2021 13:00:55 +0800 Message-ID: <20211025050055.1129845-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211024_215310_081295_029AA39D X-CRM114-Status: GOOD ( 10.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In case of error, the function of_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Claudiu Beznea --- drivers/irqchip/irq-mchp-eic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-mchp-eic.c b/drivers/irqchip/irq-mchp-eic.c index 09b7a8cdb611..c726a19837d2 100644 --- a/drivers/irqchip/irq-mchp-eic.c +++ b/drivers/irqchip/irq-mchp-eic.c @@ -209,7 +209,7 @@ static int mchp_eic_init(struct device_node *node, struct device_node *parent) return -ENOMEM; eic->base = of_iomap(node, 0); - if (IS_ERR(eic->base)) { + if (!eic->base) { ret = -ENOMEM; goto free; }