diff mbox series

[v2,21/83] bus/ifpga: remove unnecessary NULL checks

Message ID 20220124174719.14417-22-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/bus/ifpga/ifpga_bus.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index c5c8bbd57219..e005f2cb70b3 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -191,10 +191,8 @@  ifpga_scan_one(struct rte_rawdev *rawdev,
 	return afu_dev;
 
 end:
-	if (kvlist)
-		rte_kvargs_free(kvlist);
-	if (path)
-		free(path);
+	rte_kvargs_free(kvlist);
+	free(path);
 	if (afu_dev) {
 		rte_intr_instance_free(afu_dev->intr_handle);
 		free(afu_dev);
@@ -254,10 +252,8 @@  ifpga_scan(void)
 	}
 
 end:
-	if (kvlist)
-		rte_kvargs_free(kvlist);
-	if (name)
-		free(name);
+	rte_kvargs_free(kvlist);
+	free(name);
 
 	return 0;
 }