[alsa-devel] [PATCH 2/2] ASoC: bfin: fix memory leak in sport3 controller driver

Scott Jiang scott.jiang.linux at gmail.com
Fri Aug 10 00:08:40 CEST 2012


Signed-off-by: Scott Jiang <scott.jiang.linux at gmail.com>
---
 sound/soc/blackfin/bf6xx-sport.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/sound/soc/blackfin/bf6xx-sport.c b/sound/soc/blackfin/bf6xx-sport.c
index 318c5ba..dfb7443 100644
--- a/sound/soc/blackfin/bf6xx-sport.c
+++ b/sound/soc/blackfin/bf6xx-sport.c
@@ -413,7 +413,14 @@ EXPORT_SYMBOL(sport_create);
 
 void sport_delete(struct sport_device *sport)
 {
+	if (sport->tx_desc)
+		dma_free_coherent(NULL, sport->tx_desc_size,
+				sport->tx_desc, 0);
+	if (sport->rx_desc)
+		dma_free_coherent(NULL, sport->rx_desc_size,
+				sport->rx_desc, 0);
 	sport_free_resource(sport);
+	kfree(sport);
 }
 EXPORT_SYMBOL(sport_delete);
 
-- 
1.7.0.4




More information about the Alsa-devel mailing list