[ovs-dev] [PATCH 2/2] Datapath: Fix ovs_vport_init unreachable code and goto labels

Alin Gabriel Serdean aserdean at ovn.org
Mon Jul 9 13:09:45 UTC 2018


The line "ovs_stt_cleanup_module();" was unreachable. Looking
at the rest of the goto labels they also seem wrong, so fix them also.

Found using static analysis tools.

Signed-off-by: Alin Gabriel Serdean <aserdean at ovn.org>
---
 datapath/vport.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/datapath/vport.c b/datapath/vport.c
index 02f6b56d3..5f11dd6ad 100644
--- a/datapath/vport.c
+++ b/datapath/vport.c
@@ -93,22 +93,23 @@ int ovs_vport_init(void)
 		goto err_stt;
 
 	return 0;
-	ovs_stt_cleanup_module();
+
 err_stt:
-	vxlan_cleanup_module();
+	ovs_stt_cleanup_module();
 err_vxlan:
-	geneve_cleanup_module();
+	vxlan_cleanup_module();
 err_geneve:
-	ip6_tunnel_cleanup();
+	geneve_cleanup_module();
 err_ip6_tunnel:
-	ip6gre_fini();
+	ip6_tunnel_cleanup();
 err_ip6gre:
-	ipgre_fini();
+	ip6gre_fini();
 err_ipgre:
-	gre_exit();
+	ipgre_fini();
 err_gre:
-	lisp_cleanup_module();
+	gre_exit();
 err_lisp:
+	lisp_cleanup_module();
 	kfree(dev_table);
 	return err;
 }
-- 
2.16.1.windows.1



More information about the dev mailing list