diff mbox series

[v2,77/83] compressdev: remove unnecessary NULL checks

Message ID 20220124174719.14417-78-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:47 p.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

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

Comments

Zhang, Roy Fan Jan. 27, 2022, 11:07 a.m. UTC | #1
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Monday, January 24, 2022 5:47 PM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Ashish Gupta <ashish.gupta@marvell.com>
> Subject: [PATCH v2 77/83] compressdev: remove unnecessary NULL checks
> 
> Remove redundant NULL pointer checks before free functions
> found by nullfree.cocci
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/compressdev/rte_compressdev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/lib/compressdev/rte_compressdev.c
> b/lib/compressdev/rte_compressdev.c
> index 2e9218af68f6..d4f7d4d3daf2 100644
> --- a/lib/compressdev/rte_compressdev.c
> +++ b/lib/compressdev/rte_compressdev.c
> @@ -405,8 +405,7 @@ rte_compressdev_queue_pairs_release(struct
> rte_compressdev *dev)
>  			return ret;
>  	}
> 
> -	if (dev->data->queue_pairs != NULL)
> -		rte_free(dev->data->queue_pairs);
> +	rte_free(dev->data->queue_pairs);
>  	dev->data->queue_pairs = NULL;
>  	dev->data->nb_queue_pairs = 0;
> 
> --
> 2.30.2
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
diff mbox series

Patch

diff --git a/lib/compressdev/rte_compressdev.c b/lib/compressdev/rte_compressdev.c
index 2e9218af68f6..d4f7d4d3daf2 100644
--- a/lib/compressdev/rte_compressdev.c
+++ b/lib/compressdev/rte_compressdev.c
@@ -405,8 +405,7 @@  rte_compressdev_queue_pairs_release(struct rte_compressdev *dev)
 			return ret;
 	}
 
-	if (dev->data->queue_pairs != NULL)
-		rte_free(dev->data->queue_pairs);
+	rte_free(dev->data->queue_pairs);
 	dev->data->queue_pairs = NULL;
 	dev->data->nb_queue_pairs = 0;