Commit 30670539 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Mark Brown

spi: au1550: Fix bug in deallocation of memory

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: default avatarHimangi Saraogi <himangi774@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 7171511e
......@@ -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:
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment