aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Guzman Lugo <fernando.lugo@ti.com>2011-11-03 15:16:11 -0500
committerFernando Guzman Lugo <fernando.lugo@ti.com>2011-11-03 15:16:11 -0500
commit352fdd9e65ab0e6fc46821aaa538d7b092fadd60 (patch)
treeeba5f311341a3682dcaaa8a751204e09f4d80c2d
parent768b791a7f92e479569588a732924080d237933c (diff)
downloadkernel_samsung_tuna-352fdd9e65ab0e6fc46821aaa538d7b092fadd60.zip
kernel_samsung_tuna-352fdd9e65ab0e6fc46821aaa538d7b092fadd60.tar.gz
kernel_samsung_tuna-352fdd9e65ab0e6fc46821aaa538d7b092fadd60.tar.bz2
omap: mailbox: check iomem resource before dereferencing it
Add a NULL check for iomem resource in mailbox probe functions Change-Id: Ib277fbe5a69a0070416b9b8c6d0f7094da0a8bda Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
-rw-r--r--arch/arm/mach-omap1/mailbox.c3
-rw-r--r--arch/arm/mach-omap2/mailbox.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index c0e1f48..99971bf 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -151,6 +151,9 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)
list[0]->irq = platform_get_irq_byname(pdev, "dsp");
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!mem)
+ return -ENODEV;
+
mbox_base = ioremap(mem->start, resource_size(mem));
if (!mbox_base)
return -ENOMEM;
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index d94205d..74750bf 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -397,6 +397,9 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!mem)
+ return -ENODEV;
+
mbox_base = ioremap(mem->start, resource_size(mem));
if (!mbox_base)
return -ENOMEM;