aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReece R. Pollack2015-02-13 11:03:53 -0600
committerReece R. Pollack2015-02-16 16:28:59 -0600
commitb03561ff560f1f4ad6fccc1047158f751897ff22 (patch)
tree940f75e5f4de5286c0e50a27c143e70b6c956866
parent3088db2a13388781b2e71371f47ef6581a30b326 (diff)
downloadlinux-b03561ff560f1f4ad6fccc1047158f751897ff22.tar.gz
linux-b03561ff560f1f4ad6fccc1047158f751897ff22.tar.xz
linux-b03561ff560f1f4ad6fccc1047158f751897ff22.zip
dma: keystone: Fix memory leak freeing DMA descriptors
This patch corrects a memory leak when freeing software DMA descriptors. The loop containing the error was intended to identify any hardware DMA descriptors which did not get freed by the previous loop, but do to missing braces ({..}) it always set "leaked" to "true" which prevented the software descriptor array from being freed. Signed-off-by: Reece R. Pollack <x0183204@ti.com>
-rw-r--r--drivers/dma/keystone-pktdma.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/dma/keystone-pktdma.c b/drivers/dma/keystone-pktdma.c
index 3b56275466e..b44b5fb9102 100644
--- a/drivers/dma/keystone-pktdma.c
+++ b/drivers/dma/keystone-pktdma.c
@@ -1165,9 +1165,12 @@ static void chan_destroy_descs(struct keystone_dma_chan *chan)
1165 1165
1166 for (i = 0; i < chan->num_descs; i++) { 1166 for (i = 0; i < chan->num_descs; i++) {
1167 desc = desc_from_index(chan, i); 1167 desc = desc_from_index(chan, i);
1168 if (desc->hwdesc) 1168 if (desc->hwdesc) {
1169 dev_warn(chan_dev(chan), "%s leaked descriptor %d\n",
1170 chan->achan.name, i);
1169 desc_dump(chan, desc, "leaked descriptor"); 1171 desc_dump(chan, desc, "leaked descriptor");
1170 leaked = true; 1172 leaked = true;
1173 }
1171 } 1174 }
1172 1175
1173 if (!leaked) 1176 if (!leaked)