Skip to contentSkip to conversation

async_pq_val: fix DMA memory leak

PATCH Applied Justin Maggard 3 participants 3 messages Oct 4, 2016 – Oct 5, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 async_pq_val: fix DMA memory leak

Add missing dmaengine_unmap_put(), so we don't OOM during RAID6 sync.

Fixes 1786b943dad0 ("async_pq_val: convert to dmaengine_unmap_data")
---
 crypto/async_tx/async_pq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
crypto/async_tx/async_pq.c +4 -4
index 08b3ac6..f83de99 100644
@@ -368,8 +368,6 @@ async_syndrome_val(struct page **blocks, unsigned int offset, int disks,
 
 		dma_set_unmap(tx, unmap);
 		async_tx_submit(chan, tx, submit);
-
-		return tx;
 	} else {
 		struct page *p_src = P(blocks, disks);
 		struct page *q_src = Q(blocks, disks);
@@ -424,9 +422,11 @@ async_syndrome_val(struct page **blocks, unsigned int offset, int disks,
 		submit->cb_param = cb_param_orig;
 		submit->flags = flags_orig;
 		async_tx_sync_epilog(submit);
-
-		return NULL;
+		tx = NULL;
 	}
+	dmaengine_unmap_put(unmap);
+
+	return tx;
 }
 EXPORT_SYMBOL_GPL(async_syndrome_val);
 
Signature · 1 line
2.10.1
Reviewed-by on v1 1/1
#1 lore raw

[ adding Vinod ]

Quoted 4 lines · Justin Maggard

Add missing dmaengine_unmap_put(), so we don't OOM during RAID6 sync.

Fixes 1786b943dad0 ("async_pq_val: convert to dmaengine_unmap_data")
Quoted 34 lines
---
 crypto/async_tx/async_pq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
crypto/async_tx/async_pq.c +4 -5
index 08b3ac6..f83de99 100644
@@ -368,8 +368,6 @@ async_syndrome_val(struct page **blocks, unsigned int offset, int disks,
 
                dma_set_unmap(tx, unmap);
                async_tx_submit(chan, tx, submit);
-
-               return tx;
        } else {
                struct page *p_src = P(blocks, disks);
                struct page *q_src = Q(blocks, disks);
@@ -424,9 +422,11 @@ async_syndrome_val(struct page **blocks, unsigned int offset, int disks,
                submit->cb_param = cb_param_orig;
                submit->flags = flags_orig;
                async_tx_sync_epilog(submit);
-
-               return NULL;
+               tx = NULL;
        }
+       dmaengine_unmap_put(unmap);
+
+       return tx;
 }
 EXPORT_SYMBOL_GPL(async_syndrome_val);
 
--

2.10.1