2022-08-25 07:25:50

by Jinpu Wang

[permalink] [raw]
Subject: [PATCH] net/mlx4: Fix error check for dma_map_sg

dma_map_sg return 0 on error.

Cc: Tariq Toukan <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Signed-off-by: Jack Wang <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
---
drivers/net/ethernet/mellanox/mlx4/icm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

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;
}

--
2.34.1


2022-08-27 00:51:43

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net/mlx4: Fix error check for dma_map_sg

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <[email protected]>:

On Thu, 25 Aug 2022 08:35:33 +0200 you wrote:
> dma_map_sg return 0 on error.
>
> Cc: Tariq Toukan <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: Eric Dumazet <[email protected]>
> Cc: Jakub Kicinski <[email protected]>
> Cc: Paolo Abeni <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
>
> [...]

Here is the summary with links:
- net/mlx4: Fix error check for dma_map_sg
https://git.kernel.org/netdev/net-next/c/0c1f77d87d69

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html