diff mbox series

[v2,68/83] net/virtio: remove unnecessary NULL checks

Message ID 20220124174719.14417-69-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:47 p.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_user_ethdev.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 0271098f0da0..f6288fd0c492 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -688,14 +688,10 @@  virtio_user_pmd_probe(struct rte_vdev_device *vdev)
 	ret = 0;
 
 end:
-	if (kvlist)
-		rte_kvargs_free(kvlist);
-	if (path)
-		free(path);
-	if (mac_addr)
-		free(mac_addr);
-	if (ifname)
-		free(ifname);
+	rte_kvargs_free(kvlist);
+	free(path);
+	free(mac_addr);
+	free(ifname);
 	return ret;
 }