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:
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue