Patchwork OMAP: McSPI: Fix Null pointer check

login
register
mail settings
Submitter manjugk manjugk
Date May 20, 2010, 2:29 p.m.
Message ID <1274365792-24938-2-git-send-email-manjugk@ti.com>
Download mbox | patch
Permalink /patch/101196/
State Awaiting Upstream, archived
Headers show

Comments

Patch

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index e0de0d0..a95d306 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -1198,6 +1198,8 @@  static int __exit omap2_mcspi_remove(struct platform_device *pdev)
 	clk_put(mcspi->ick);
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (r == NULL)
+		return -EINVAL;
 	release_mem_region(r->start, (r->end - r->start) + 1);
 
 	base = mcspi->base;