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: https://github.com/raspberrypi/linux/issues/6733

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
Phil Elwell
2025-03-20 16:40:02 +00:00
committed by Dom Cobley
parent 72a36feda1
commit 3a67ada69d

View File

@@ -367,6 +367,7 @@ static void axi_desc_put(struct axi_dma_desc *desc)
for (descs_put = 0; descs_put < count; descs_put++) { for (descs_put = 0; descs_put < count; descs_put++) {
hw_desc = &desc->hw_desc[descs_put]; hw_desc = &desc->hw_desc[descs_put];
if (hw_desc->lli)
dma_pool_free(chan->desc_pool, hw_desc->lli, hw_desc->llp); dma_pool_free(chan->desc_pool, hw_desc->lli, hw_desc->llp);
} }