mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
crypto: marvell/octeontx - fix DMA cleanup using wrong loop index
The sg_cleanup path used list[i] instead of list[j] when unmapping DMA
buffers, leaking successfully mapped entries and repeatedly unmapping
the failed one.
Fixes: 10b4f09491 ("crypto: marvell - add the Virtual Function driver for CPT")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
51f4493085
commit
7891c64c05
|
|
@ -157,8 +157,8 @@ static inline int setup_sgio_components(struct pci_dev *pdev,
|
|||
sg_cleanup:
|
||||
for (j = 0; j < i; j++) {
|
||||
if (list[j].dma_addr) {
|
||||
dma_unmap_single(&pdev->dev, list[i].dma_addr,
|
||||
list[i].size, DMA_BIDIRECTIONAL);
|
||||
dma_unmap_single(&pdev->dev, list[j].dma_addr,
|
||||
list[j].size, DMA_BIDIRECTIONAL);
|
||||
}
|
||||
|
||||
list[j].dma_addr = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user