Skip to content

Commit 936001a

Browse files
pelwellpopcornmix
authored andcommitted
dmaengine: dw-axi-dmac: Improve axi_desc_put
axi_desc_put often gets called in error paths, and so can't assume that the descriptor passed in has been completely initialised. Guard against unallocated LLIs. See: #6733 Signed-off-by: Phil Elwell <[email protected]>
1 parent bc47be1 commit 936001a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ static void axi_desc_put(struct axi_dma_desc *desc)
367367

368368
for (descs_put = 0; descs_put < count; descs_put++) {
369369
hw_desc = &desc->hw_desc[descs_put];
370-
dma_pool_free(chan->desc_pool, hw_desc->lli, hw_desc->llp);
370+
if (hw_desc->lli)
371+
dma_pool_free(chan->desc_pool, hw_desc->lli, hw_desc->llp);
371372
}
372373

373374
kfree(desc->hw_desc);

0 commit comments

Comments
 (0)