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

Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 drivers/raw/ifpga/ifpga_rawdev.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index 0eae0c9477b6..c68e378dc3ce 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -836,8 +836,7 @@ rte_fpga_do_pr(struct rte_rawdev *rawdev, int port_id,
        }
 
 free_buffer:
-       if (buf_to_free)
-               rte_free(buf_to_free);
+       rte_free(buf_to_free);
 close_fd:
        close(file_fd);
        file_fd = 0;
@@ -1739,10 +1738,8 @@ ifpga_cfg_probe(struct rte_vdev_device *dev)
        ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
                        dev_name, devargs->args);
 end:
-       if (kvlist)
-               rte_kvargs_free(kvlist);
-       if (name)
-               free(name);
+       rte_kvargs_free(kvlist);
+       free(name);
 
        return ret;
 }
-- 
2.30.2

Reply via email to