[4/6] SPI: S3C64XX: Check before mem-region release
diff mbox

Message ID 1263808215-16544-4-git-send-email-jassisinghbrar@gmail.com
State Accepted
Headers show

Commit Message

Jassi Brar Jan. 18, 2010, 9:50 a.m. UTC
None

Patch
diff mbox

diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c
index 3acf381..0e883f9 100644
--- a/drivers/spi/spi_s3c64xx.c
+++ b/drivers/spi/spi_s3c64xx.c
@@ -1097,7 +1097,8 @@  static int s3c64xx_spi_remove(struct platform_device *pdev)
 	iounmap((void *) sdd->regs);
 
 	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	release_mem_region(mem_res->start, resource_size(mem_res));
+	if (mem_res != NULL)
+		release_mem_region(mem_res->start, resource_size(mem_res));
 
 	platform_set_drvdata(pdev, NULL);
 	spi_master_put(master);