Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940182AbdD3Jrd (ORCPT ); Sun, 30 Apr 2017 05:47:33 -0400 Received: from terminus.zytor.com ([65.50.211.136]:59135 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938779AbdD3JrZ (ORCPT ); Sun, 30 Apr 2017 05:47:25 -0400 Date: Sun, 30 Apr 2017 02:45:59 -0700 From: tip-bot for Wei Yongjun Message-ID: Cc: marc.zyngier@arm.com, weiyongjun1@huawei.com, wangkefeng.wang@huawei.com, linux-kernel@vger.kernel.org, jason@lakedaemon.net, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de Reply-To: wangkefeng.wang@huawei.com, weiyongjun1@huawei.com, marc.zyngier@arm.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, jason@lakedaemon.net In-Reply-To: <20170427152113.31147-1-weiyj.lk@gmail.com> References: <20170427152113.31147-1-weiyj.lk@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] irqchip/mbigen: Fix return value check in mbigen_device_probe() Git-Commit-ID: 216646e4d82e847791f0ba66c439dedd36cb119f 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 Content-Length: 1574 Lines: 39 Commit-ID: 216646e4d82e847791f0ba66c439dedd36cb119f Gitweb: http://git.kernel.org/tip/216646e4d82e847791f0ba66c439dedd36cb119f Author: Wei Yongjun AuthorDate: Thu, 27 Apr 2017 15:21:13 +0000 Committer: Thomas Gleixner CommitDate: Sun, 30 Apr 2017 11:21:16 +0200 irqchip/mbigen: Fix return value check in mbigen_device_probe() In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). Use devm_ioremap_resource() instead of devm_ioremap() to fix the IS_ERR() test issue. Fixes: 76e1f77f9c26 ("irqchip/mbigen: Introduce mbigen_of_create_domain()") Signed-off-by: Wei Yongjun Cc: Marc Zyngier Cc: Kefeng Wang Cc: Jason Cooper Link: http://lkml.kernel.org/r/20170427152113.31147-1-weiyj.lk@gmail.com Signed-off-by: Thomas Gleixner --- drivers/irqchip/irq-mbigen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index 061cdb8..d2306c8 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -337,8 +337,7 @@ static int mbigen_device_probe(struct platform_device *pdev) mgn_chip->pdev = pdev; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mgn_chip->base = devm_ioremap(&pdev->dev, res->start, - resource_size(res)); + mgn_chip->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(mgn_chip->base)) return PTR_ERR(mgn_chip->base);