Re: [PATCH] dmaengine: loongson2-apb-cmc: fix descriptor leak in prep_slave_sg()

From: Vinod Koul

Date: Mon Oct 05 2026 - 11:49:10 EST



On Sat, 05 Sep 2026 00:28:33 -0600, Diego Fernando Mancera Gomez wrote:
> loongson2_cmc_dma_prep_slave_sg() allocates the descriptor with
> kzalloc_flex() before iterating over the scatterlist. If
> loongson2_cmc_dma_set_xfer_param() fails inside the loop, the function
> returns ERR_PTR(ret) without freeing the descriptor. At this point the
> descriptor has not been handed to vchan_tx_prep() yet, so nothing else
> will ever free it, leaking it on every failed ->device_prep_slave_sg()
> call (e.g. an unsupported transfer direction or bus width).
>
> [...]

Applied, thanks!

[1/1] dmaengine: loongson2-apb-cmc: fix descriptor leak in prep_slave_sg()
commit: 4bbfc1d7e56134336dd1f792f51ee88a600a27ad

Best regards,
--
~Vinod