diff mbox series

[v2,54/83] net/igc: remove unnecessary NULL checks

Message ID 20220124174719.14417-55-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/igc/igc_flow.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Wang, Haiyue Jan. 25, 2022, 12:44 a.m. UTC | #1
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, January 25, 2022 01:47
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Wang, Haiyue <haiyue.wang@intel.com>
> Subject: [PATCH v2 54/83] net/igc: remove unnecessary NULL checks
> 
> Remove redundant NULL pointer checks before free functions
> found by nullfree.cocci
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/net/igc/igc_flow.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 

Acked-by: Haiyue Wang <haiyue.wang@intel.com>

> 2.30.2
diff mbox series

Patch

diff --git a/drivers/net/igc/igc_flow.c b/drivers/net/igc/igc_flow.c
index 66053060af5a..58a6a8a539c6 100644
--- a/drivers/net/igc/igc_flow.c
+++ b/drivers/net/igc/igc_flow.c
@@ -775,10 +775,7 @@  igc_flow_create(struct rte_eth_dev *dev,
 	}
 
 	if (ret) {
-		/* check and free the memory */
-		if (flow)
-			rte_free(flow);
-
+		rte_free(flow);
 		rte_flow_error_set(error, -ret,
 				RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
 				"Failed to create flow.");