diff options
| author | Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com> | 2026-09-05 00:28:33 -0600 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-10-05 15:57:07 +0200 |
| commit | 4bbfc1d7e56134336dd1f792f51ee88a600a27ad (patch) | |
| tree | be65735e2e6a3d5bc40eedf480c69b103816bff5 /tools/lib/python/kdoc/python_version.py | |
| parent | a5b2763df36b5c8ca0927f24ee97d9617e4eb6eb (diff) | |
dmaengine: loongson2-apb-cmc: fix descriptor leak in prep_slave_sg()
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).
The neighbouring error path for the num_items check already frees the
descriptor before returning; do the same on the set_xfer_param() failure
path.
Fixes: 1c0028e725f1 ("dmaengine: loongson: New driver for the Loongson Multi-Channel DMA controller")
Link: https://lore.kernel.org/all/20260818094957.7D2221F000E9@smtp.kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Diego Fernando Mancera Gomez <diegomancera.dev@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bUV3WshMSfTq61n1cgh1i
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260905062833.272484-1-diegomancera.dev@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
