mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
Fix dma_unmap_sg() nents value
[ Upstream commit1db50f7b7a
] The dma_unmap_sg() functions should be called with the same nents as the dma_map_sg(), not the value the map function returned. Fixes:ed10435d35
("RDMA/erdma: Implement hierarchical MTT") Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Link: https://patch.msgid.link/20250630092346.81017-2-fourier.thomas@gmail.com Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8724a228be
commit
a99cae46ab
|
@ -585,7 +585,8 @@ err_free_mtt:
|
|||
static void erdma_destroy_mtt_buf_sg(struct erdma_dev *dev,
|
||||
struct erdma_mtt *mtt)
|
||||
{
|
||||
dma_unmap_sg(&dev->pdev->dev, mtt->sglist, mtt->nsg, DMA_TO_DEVICE);
|
||||
dma_unmap_sg(&dev->pdev->dev, mtt->sglist,
|
||||
DIV_ROUND_UP(mtt->size, PAGE_SIZE), DMA_TO_DEVICE);
|
||||
vfree(mtt->sglist);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user