Skip to content

Commit

Permalink
spi/s3c64xx: Check before mem-region release
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jassi Brar authored and Grant Likely committed Jan 20, 2010
1 parent b0d5d6e commit ef6c680
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/spi/spi_s3c64xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ef6c680

Please sign in to comment.