diff mbox series

[1/3] vdpa/mlx5: remove unnecessary null check

Message ID 20220622185158.397779-2-stephen@networkplumber.org (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers show
Series more null pointer check removal | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger June 22, 2022, 6:51 p.m. UTC
Found by nullfree.cocci.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Matan Azrad June 23, 2022, 9:13 a.m. UTC | #1
From: Stephen Hemminger
> Found by nullfree.cocci.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Matan Azrad <matan@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
index e025be47d277..e06d6afb676f 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c
@@ -285,8 +285,7 @@  mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index)
 		if (virtq->umems[i].obj)
 			claim_zero(mlx5_glue->devx_umem_dereg
 				   (virtq->umems[i].obj));
-		if (virtq->umems[i].buf)
-			rte_free(virtq->umems[i].buf);
+		rte_free(virtq->umems[i].buf);
 		virtq->umems[i].size = 0;
 		virtq->umems[i].obj = NULL;
 		virtq->umems[i].buf = NULL;