public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Vladimir Zapolskiy <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:irq/core] irqchip/mxs: Fix error check of of_io_request_and_map()
Date: Thu, 10 Mar 2016 07:06:58 -0800	[thread overview]
Message-ID: <tip-edf8fcdc6b254236be005851af35ea5e826e7e09@git.kernel.org> (raw)
In-Reply-To: <1457486500-10237-1-git-send-email-vz@mleia.com>

Commit-ID:  edf8fcdc6b254236be005851af35ea5e826e7e09
Gitweb:     http://git.kernel.org/tip/edf8fcdc6b254236be005851af35ea5e826e7e09
Author:     Vladimir Zapolskiy <vz@mleia.com>
AuthorDate: Wed, 9 Mar 2016 03:21:40 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
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 <vz@mleia.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Oleksij Rempel <linux@rempel-privat.de>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
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 <tglx@linutronix.de>
---
 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;
 }

  reply	other threads:[~2016-03-10 15:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09  1:21 [PATCH] irqchip/mxs: fix error check of of_io_request_and_map() Vladimir Zapolskiy
2016-03-10 15:06 ` tip-bot for Vladimir Zapolskiy [this message]
2016-03-31  6:39 ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-edf8fcdc6b254236be005851af35ea5e826e7e09@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=jason@lakedaemon.net \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=marc.zyngier@arm.com \
    --cc=mingo@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vz@mleia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox