diff mbox series

[v2,57/83] net/mlx4: remove unnecessary NULL checks

Message ID 20220124174719.14417-58-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series remove unnecessary null checks | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 24, 2022, 5:46 p.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

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

Comments

Slava Ovsiienko Jan. 26, 2022, 7 a.m. UTC | #1
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Monday, January 24, 2022 19:47
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Matan Azrad
> <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Subject: [PATCH v2 57/83] net/mlx4: remove unnecessary NULL checks
> 
> Remove redundant NULL pointer checks before free functions found by
> nullfree.cocci
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/net/mlx4/mlx4_mr.c b/drivers/net/mlx4/mlx4_mr.c
index 2274b5df1950..e95f45aa3e95 100644
--- a/drivers/net/mlx4/mlx4_mr.c
+++ b/drivers/net/mlx4/mlx4_mr.c
@@ -471,8 +471,7 @@  mr_free(struct mlx4_mr *mr)
 	DEBUG("freeing MR(%p):", (void *)mr);
 	if (mr->ibv_mr != NULL)
 		claim_zero(mlx4_glue->dereg_mr(mr->ibv_mr));
-	if (mr->ms_bmp != NULL)
-		rte_bitmap_free(mr->ms_bmp);
+	rte_bitmap_free(mr->ms_bmp);
 	rte_free(mr);
 }