diff mbox series

[74/82] vdpa/ifc: remove unnecessary NULL checks

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/vdpa/ifc/ifcvf_vdpa.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c
index 3853c4cf7e85..9f05595b6b34 100644
--- a/drivers/vdpa/ifc/ifcvf_vdpa.c
+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c
@@ -226,8 +226,7 @@  ifcvf_dma_map(struct ifcvf_internal *internal, bool do_map)
 	}
 
 exit:
-	if (mem)
-		free(mem);
+	free(mem);
 	return ret;
 }
 
@@ -253,8 +252,7 @@  hva_to_gpa(int vid, uint64_t hva)
 	}
 
 exit:
-	if (mem)
-		free(mem);
+	free(mem);
 	return gpa;
 }
 
@@ -661,8 +659,7 @@  m_ifcvf_start(struct ifcvf_internal *internal)
 
 error:
 	for (i = 0; i < nr_vring; i++)
-		if (internal->m_vring[i].desc)
-			rte_free(internal->m_vring[i].desc);
+		rte_free(internal->m_vring[i].desc);
 
 	return -1;
 }