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>
This commit is contained in:
Jassi Brar 2010-01-20 13:49:44 -07:00 committed by Grant Likely
parent b0d5d6e553
commit ef6c680dc5

View file

@ -1097,6 +1097,7 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
iounmap((void *) sdd->regs);
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (mem_res != NULL)
release_mem_region(mem_res->start, resource_size(mem_res));
platform_set_drvdata(pdev, NULL);