Message ID | 20140704173949.GA8558@himangi-Dell (mailing list archive) |
---|---|
State | Accepted |
Commit | 30670539b867d08c1931abd4815699de5887ee58 |
Headers | show |
On Fri, Jul 04, 2014 at 11:09:49PM +0530, Himangi Saraogi wrote: > 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. Applied, thanks.
diff --git a/drivers/spi/spi-au1550.c b/drivers/spi/spi-au1550.c index 67375a1..fb61464 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);
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> --- drivers/spi/spi-au1550.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)