From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754880AbdKNKdL (ORCPT ); Tue, 14 Nov 2017 05:33:11 -0500 Received: from terminus.zytor.com ([65.50.211.136]:45317 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753931AbdKNKdF (ORCPT ); Tue, 14 Nov 2017 05:33:05 -0500 Date: Tue, 14 Nov 2017 02:30:41 -0800 From: tip-bot for Wei Yongjun Message-ID: Cc: mingo@kernel.org, weiyongjun1@huawei.com, tglx@linutronix.de, hpa@zytor.com, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, jason@lakedaemon.net, ard.biesheuvel@linaro.org Reply-To: weiyongjun1@huawei.com, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, jason@lakedaemon.net, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, linux-kernel@vger.kernel.org In-Reply-To: <1510642648-123574-1-git-send-email-weiyongjun1@huawei.com> References: <1510642648-123574-1-git-send-email-weiyongjun1@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/urgent] irqchip/exiu: Fix return value check in exiu_init() Git-Commit-ID: 0e54705b0e01dcaf3eb2a496bb66d5f05012056b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0e54705b0e01dcaf3eb2a496bb66d5f05012056b Gitweb: https://git.kernel.org/tip/0e54705b0e01dcaf3eb2a496bb66d5f05012056b Author: Wei Yongjun AuthorDate: Tue, 14 Nov 2017 06:57:28 +0000 Committer: Thomas Gleixner CommitDate: Tue, 14 Nov 2017 11:27:22 +0100 irqchip/exiu: Fix return value check in exiu_init() In case of error, the function of_iomap() returns NULL pointer not ERR_PTR(). Replace the IS_ERR() test of the return value with NULL test and return a proper error code. Fixes: 706cffc1b912 ("irqchip/exiu: Add support for Socionext Synquacer EXIU controller") Signed-off-by: Wei Yongjun Signed-off-by: Thomas Gleixner Acked-by: Ard Biesheuvel Cc: Marc Zyngier Cc: Jason Cooper Link: https://lkml.kernel.org/r/1510642648-123574-1-git-send-email-weiyongjun1@huawei.com --- drivers/irqchip/irq-sni-exiu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-sni-exiu.c b/drivers/irqchip/irq-sni-exiu.c index 1b6e2f7..1927b2f 100644 --- a/drivers/irqchip/irq-sni-exiu.c +++ b/drivers/irqchip/irq-sni-exiu.c @@ -196,8 +196,8 @@ static int __init exiu_init(struct device_node *node, } data->base = of_iomap(node, 0); - if (IS_ERR(data->base)) { - err = PTR_ERR(data->base); + if (!data->base) { + err = -ENODEV; goto out_free; }