Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753475AbeABLmB (ORCPT + 1 other); Tue, 2 Jan 2018 06:42:01 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:49115 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751447AbeABLl7 (ORCPT ); Tue, 2 Jan 2018 06:41:59 -0500 From: Wei Yongjun To: Jonas Bonn , Stefan Kristiansson , Stafford Horne , Thomas Gleixner , Jason Cooper , Marc Zyngier CC: Wei Yongjun , , Subject: [PATCH -next] irqchip/ompic: fix return value check in ompic_of_init() Date: Tue, 2 Jan 2018 11:47:19 +0000 Message-ID: <1514893639-70586-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: In case of error, the function ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 9b54470afd83 ("irqchip: add initial support for ompic") Signed-off-by: Wei Yongjun --- drivers/irqchip/irq-ompic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-ompic.c b/drivers/irqchip/irq-ompic.c index cf6d0c4..400b119 100644 --- a/drivers/irqchip/irq-ompic.c +++ b/drivers/irqchip/irq-ompic.c @@ -171,9 +171,9 @@ static int __init ompic_of_init(struct device_node *node, /* Setup the device */ ompic_base = ioremap(res.start, resource_size(&res)); - if (IS_ERR(ompic_base)) { + if (!ompic_base) { pr_err("ompic: unable to map registers"); - return PTR_ERR(ompic_base); + return -ENOMEM; } irq = irq_of_parse_and_map(node, 0);