Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752816AbcCJPHj (ORCPT ); Thu, 10 Mar 2016 10:07:39 -0500 Received: from torg.zytor.com ([198.137.202.12]:43146 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752779AbcCJPH3 (ORCPT ); Thu, 10 Mar 2016 10:07:29 -0500 Date: Thu, 10 Mar 2016 07:06:58 -0800 From: tip-bot for Vladimir Zapolskiy Message-ID: Cc: tglx@linutronix.de, marc.zyngier@arm.com, shawnguo@kernel.org, linux@rempel-privat.de, jason@lakedaemon.net, mingo@kernel.org, hpa@zytor.com, kernel@pengutronix.de, linux-kernel@vger.kernel.org, vz@mleia.com Reply-To: marc.zyngier@arm.com, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com, jason@lakedaemon.net, linux@rempel-privat.de, shawnguo@kernel.org, vz@mleia.com, linux-kernel@vger.kernel.org, kernel@pengutronix.de In-Reply-To: <1457486500-10237-1-git-send-email-vz@mleia.com> References: <1457486500-10237-1-git-send-email-vz@mleia.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] irqchip/mxs: Fix error check of of_io_request_and_map() Git-Commit-ID: edf8fcdc6b254236be005851af35ea5e826e7e09 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: 1595 Lines: 40 Commit-ID: edf8fcdc6b254236be005851af35ea5e826e7e09 Gitweb: http://git.kernel.org/tip/edf8fcdc6b254236be005851af35ea5e826e7e09 Author: Vladimir Zapolskiy AuthorDate: Wed, 9 Mar 2016 03:21:40 +0200 Committer: Thomas Gleixner CommitDate: Thu, 10 Mar 2016 16:03:30 +0100 irqchip/mxs: Fix error check of of_io_request_and_map() The of_io_request_and_map() returns a valid pointer in iomem region or ERR_PTR(), check for NULL always fails and may cause a NULL pointer dereference on error path. Fixes: 25e34b44313b ("irqchip/mxs: Prepare driver for hardware with different offsets") Signed-off-by: Vladimir Zapolskiy Cc: Jason Cooper Cc: Marc Zyngier Cc: Oleksij Rempel Cc: Sascha Hauer Cc: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1457486500-10237-1-git-send-email-vz@mleia.com Signed-off-by: Thomas Gleixner --- drivers/irqchip/irq-mxs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c index efe5084..1730470 100644 --- a/drivers/irqchip/irq-mxs.c +++ b/drivers/irqchip/irq-mxs.c @@ -183,7 +183,7 @@ static void __iomem * __init icoll_init_iobase(struct device_node *np) void __iomem *icoll_base; icoll_base = of_io_request_and_map(np, 0, np->name); - if (!icoll_base) + if (IS_ERR(icoll_base)) panic("%s: unable to map resource", np->full_name); return icoll_base; }