mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 01:36:52 +09:00
net/mlx4: Fix error check for dma_map_sg
dma_map_sg return 0 on error. Signed-off-by: Jack Wang <jinpu.wang@ionos.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Link: https://lore.kernel.org/r/20220825063533.21015-1-jinpu.wang@ionos.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
6005a8aece
commit
0c1f77d87d
@@ -208,7 +208,7 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
|
||||
chunk->sg, chunk->npages,
|
||||
DMA_BIDIRECTIONAL);
|
||||
|
||||
if (chunk->nsg <= 0)
|
||||
if (!chunk->nsg)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
|
||||
chunk->nsg = dma_map_sg(&dev->persist->pdev->dev, chunk->sg,
|
||||
chunk->npages, DMA_BIDIRECTIONAL);
|
||||
|
||||
if (chunk->nsg <= 0)
|
||||
if (!chunk->nsg)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user