diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-07-04 13:39:49 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-04 14:33:40 -0400 |
commit | 30670539b867d08c1931abd4815699de5887ee58 (patch) | |
tree | a7cb9c796e98e3c55663f82f3473707512b12356 | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
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>
-rw-r--r-- | drivers/spi/spi-au1550.c | 6 |
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: | |||
925 | iounmap((void __iomem *)hw->regs); | 925 | iounmap((void __iomem *)hw->regs); |
926 | 926 | ||
927 | err_ioremap: | 927 | err_ioremap: |
928 | release_resource(hw->ioarea); | 928 | release_mem_region(r->start, sizeof(psc_spi_t)); |
929 | kfree(hw->ioarea); | ||
930 | 929 | ||
931 | err_no_iores: | 930 | err_no_iores: |
932 | err_no_pdata: | 931 | err_no_pdata: |
@@ -946,8 +945,7 @@ static int au1550_spi_remove(struct platform_device *pdev) | |||
946 | spi_bitbang_stop(&hw->bitbang); | 945 | spi_bitbang_stop(&hw->bitbang); |
947 | free_irq(hw->irq, hw); | 946 | free_irq(hw->irq, hw); |
948 | iounmap((void __iomem *)hw->regs); | 947 | iounmap((void __iomem *)hw->regs); |
949 | release_resource(hw->ioarea); | 948 | release_mem_region(r->start, sizeof(psc_spi_t)); |
950 | kfree(hw->ioarea); | ||
951 | 949 | ||
952 | if (hw->usedma) { | 950 | if (hw->usedma) { |
953 | au1550_spi_dma_rxtmp_free(hw); | 951 | au1550_spi_dma_rxtmp_free(hw); |