aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2010-01-20 13:49:44 -0700
committerGrant Likely <grant.likely@secretlab.ca>2010-01-20 13:49:44 -0700
commitef6c680dc5a182a79b09567168d6713f46c85784 (patch)
tree86415b8562bcb2a811ca31460ab44ed9786371eb /drivers/spi
parentb0d5d6e55340348b0de75eb691b93d7e60dba879 (diff)
spi/s3c64xx: Check before mem-region release
Add precautionary check before releasing memory region. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi_s3c64xx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c
index 3acf38119e9..0e883f9c720 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);