From: Gurucharan Shetty Date: Tue, 22 Apr 2014 17:18:02 +0000 (-0700) Subject: ofproto: Don't destroy mutex before its use. X-Git-Tag: sliver-openvswitch-2.2.90-1~3^2~73 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=5c09b672114fab2357c8ce71d608d486eb5ae1ae;ds=sidebyside ofproto: Don't destroy mutex before its use. Currently, we are calling guarded_list_destroy() to destroy a mutex and then go ahead and use it through delete_group ->delete_group__ ->handle_flow_mod__ ->run_rule_executes ->guarded_list_pop_all The group related unit tests cause ovs-vswitchd to crash because of this (on windows). Calling guarded_list_destroy() after delete_group() solves the problem. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 659990ecf..49444c193 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1311,9 +1311,9 @@ ofproto_destroy__(struct ofproto *ofproto) ovs_assert(list_is_empty(&ofproto->pending)); destroy_rule_executes(ofproto); - guarded_list_destroy(&ofproto->rule_executes); - delete_group(ofproto, OFPG_ALL); + + guarded_list_destroy(&ofproto->rule_executes); ovs_rwlock_destroy(&ofproto->groups_rwlock); hmap_destroy(&ofproto->groups);