Skip to content

Commit

Permalink
spi: au1550: Fix bug in deallocation of memory
Browse files Browse the repository at this point in the history
This patch fixes a bug on the deallocation of memory allocated using
request_mem_region, by using release_mem_region instead of
release_resource and kfree.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Himangi Saraogi authored and Mark Brown committed Jul 4, 2014
1 parent 7171511 commit 3067053
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/spi/spi-au1550.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,8 +925,7 @@ static int au1550_spi_probe(struct platform_device *pdev)
iounmap((void __iomem *)hw->regs);

err_ioremap:
release_resource(hw->ioarea);
kfree(hw->ioarea);
release_mem_region(r->start, sizeof(psc_spi_t));

err_no_iores:
err_no_pdata:
Expand All @@ -946,8 +945,7 @@ static int au1550_spi_remove(struct platform_device *pdev)
spi_bitbang_stop(&hw->bitbang);
free_irq(hw->irq, hw);
iounmap((void __iomem *)hw->regs);
release_resource(hw->ioarea);
kfree(hw->ioarea);
release_mem_region(r->start, sizeof(psc_spi_t));

if (hw->usedma) {
au1550_spi_dma_rxtmp_free(hw);
Expand Down

0 comments on commit 3067053

Please sign in to comment.