Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <step...@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 --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;
        }
-- 
2.30.2

Reply via email to