Commit 0c1f77d8 authored by Jack Wang's avatar Jack Wang Committed by Jakub Kicinski
Browse files

net/mlx4: Fix error check for dma_map_sg

parent 6005a8ae
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}