diff mbox series

[v1,19/19] net/mlx4: Fix error check for dma_map_sg

Message ID 20220819060801.10443-20-jinpu.wang@ionos.com (mailing list archive)
State Not Applicable
Headers show
Series None | expand

Commit Message

Jinpu Wang Aug. 19, 2022, 6:08 a.m. UTC
dma_map_sg return 0 on error.

Cc: Tariq Toukan <tariqt@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Cc: linux-rdma@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
---
 drivers/net/ethernet/mellanox/mlx4/icm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Leon Romanovsky Aug. 21, 2022, 11:42 a.m. UTC | #1
On Fri, Aug 19, 2022 at 08:08:01AM +0200, Jack Wang wrote:
> dma_map_sg return 0 on error.
> 
> Cc: Tariq Toukan <tariqt@nvidia.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-rdma@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> 
> Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
> ---
>  drivers/net/ethernet/mellanox/mlx4/icm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Jakub Kicinski Aug. 22, 2022, 6:20 p.m. UTC | #2
On Fri, 19 Aug 2022 08:08:01 +0200 Jack Wang wrote:
> dma_map_sg return 0 on error.

You need to resend it as an individual patch, not part of a series if
you want it to be applied to the networking tree. Please keep Leon's
review tag.
Jinpu Wang Aug. 24, 2022, 2:39 p.m. UTC | #3
On Mon, Aug 22, 2022 at 8:20 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Fri, 19 Aug 2022 08:08:01 +0200 Jack Wang wrote:
> > dma_map_sg return 0 on error.
>
> You need to resend it as an individual patch, not part of a series if
> you want it to be applied to the networking tree. Please keep Leon's
> review tag.
Got it. Will do
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c
index d89a3da89e5a..59b8b3c73582 100644
--- a/drivers/net/ethernet/mellanox/mlx4/icm.c
+++ b/drivers/net/ethernet/mellanox/mlx4/icm.c
@@ -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;
 	}