summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/mailbox.c
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2013-02-01 20:24:51 -0600
committerSuman Anna <s-anna@ti.com>2013-06-11 09:44:02 -0500
commita41677c6c5160f031038951fb94defeb93fe8160 (patch)
treefdc800339a983bb153a67d52cd155a383c67e0d2 /arch/arm/mach-omap2/mailbox.c
parent317ddd256b9c24b0d78fa8018f80f1e495481a10 (diff)
downloadlinux-a41677c6c5160f031038951fb94defeb93fe8160.tar.gz
linux-a41677c6c5160f031038951fb94defeb93fe8160.tar.bz2
linux-a41677c6c5160f031038951fb94defeb93fe8160.zip
omap: mailbox: check iomem resource before dereferencing it
Add a NULL check for iomem resource in mailbox probe functions. Signed-off-by: Fernando Guzman Lugo <lugo.fernando@gmail.com> Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/mailbox.c')
-rw-r--r--arch/arm/mach-omap2/mailbox.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 0b080267b7f6..9fe0bf2fef33 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -382,6 +382,9 @@ static int omap2_mbox_probe(struct platform_device *pdev)
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!mem)
+ return -ENOENT;
+
mbox_base = ioremap(mem->start, resource_size(mem));
if (!mbox_base)
return -ENOMEM;