ASoC: bfin: fix memory leak in sport3 controller driver
authorScott Jiang <scott.jiang.linux@gmail.com>
Thu, 9 Aug 2012 22:08:40 +0000 (18:08 -0400)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 9 Aug 2012 13:08:59 +0000 (14:08 +0100)
Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/blackfin/bf6xx-sport.c

index 318c5ba5360f6dfb3e9184aa9f169ad0f23aa3a4..dfb744381c42cb2288b7bb7325fdb04b04338b82 100644 (file)
@@ -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);