diff mbox series

[61/82] net/octeontx: remove unnecessary NULL checks

Message ID 20220124000518.319850-62-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, 12:04 a.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/octeontx/octeontx_ethdev.c     | 3 +--
 drivers/net/octeontx/octeontx_ethdev_ops.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index b47472ebbd93..f5ea9de8efe5 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -1037,8 +1037,7 @@  octeontx_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,
 	return res;
 
 err:
-	if (txq)
-		rte_free(txq);
+	rte_free(txq);
 
 	return res;
 }
diff --git a/drivers/net/octeontx/octeontx_ethdev_ops.c b/drivers/net/octeontx/octeontx_ethdev_ops.c
index 6ec2b71b0672..0b22e28a5625 100644
--- a/drivers/net/octeontx/octeontx_ethdev_ops.c
+++ b/drivers/net/octeontx/octeontx_ethdev_ops.c
@@ -108,8 +108,7 @@  octeontx_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 	if (rc != 0) {
 		octeontx_log_err("Fail to configure vlan filter entry "
 				 "for port %d", nic->port_id);
-		if (entry)
-			rte_free(entry);
+		rte_free(entry);
 
 		goto done;
 	}