summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-au1550.c
diff options
context:
space:
mode:
authorHimangi Saraogi <himangi774@gmail.com>2014-07-04 21:39:49 +0400
committerMark Brown <broonie@linaro.org>2014-07-04 22:33:40 +0400
commit30670539b867d08c1931abd4815699de5887ee58 (patch)
treea7cb9c796e98e3c55663f82f3473707512b12356 /drivers/spi/spi-au1550.c
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
downloadlinux-30670539b867d08c1931abd4815699de5887ee58.tar.xz
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: Himangi Saraogi <himangi774@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-au1550.c')
-rw-r--r--drivers/spi/spi-au1550.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/spi/spi-au1550.c b/drivers/spi/spi-au1550.c
index 67375a11d4bd..fb61464348a1 100644
--- a/drivers/spi/spi-au1550.c
+++ b/drivers/spi/spi-au1550.c
@@ -925,8 +925,7 @@ err_no_txdma:
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);