diff options
| author | Hongjian Dai <daihongjian@kylinsec.com.cn> | 2026-10-08 20:47:04 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-13 21:40:45 +0100 |
| commit | 9d71f9fe5b5de916bded51343138b09b1eb103ed (patch) | |
| tree | bd32caf4cf660132bb6919af0d52a81b76fbe6e7 /tools/perf/scripts/python | |
| parent | dcdf23067adf6ccee5c0e2649430f00f484827f0 (diff) | |
spi: meson-spicc: fix invalid DMA unmap on mapping failure
meson_spicc_dma_unmap() decided whether a buffer had to be unmapped by
testing its DMA address for non-zero. On a mapping failure
dma_map_single() returns DMA_MAPPING_ERROR (typically non-zero), so the
error path in meson_spicc_transfer_one() passed that error value to
dma_unmap_single(), unmapping an address which was never mapped. The
same happened for t->rx_dma on TX mapping failure, which is not written
at all.
Initialize both addresses to DMA_MAPPING_ERROR before mapping and use
dma_mapping_error() to decide, so only buffers which were actually
mapped are unmapped.
Fixes: 18197e98353d ("spi: meson-spicc: add DMA support")
Signed-off-by: Hongjian Dai <daihongjian@kylinsec.com.cn>
Link: https://patch.msgid.link/35143466F2F5166F+20261008124704.87708-1-daihongjian@kylinsec.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
