]> git.proxmox.com Git - ovs.git/commitdiff
ofproto-dpif: Put bundle_lookup ahead to simplify the code.
authorDuan Jiong <djduanjiong@gmail.com>
Fri, 8 Sep 2017 01:51:38 +0000 (09:51 +0800)
committerBen Pfaff <blp@ovn.org>
Fri, 3 Nov 2017 19:24:49 +0000 (12:24 -0700)
Signed-off-by: Duan Jiong <djduanjiong@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
ofproto/ofproto-dpif.c

index 6daedddb5894c7bdd2fc6a3697d30193364b8fb9..0e86d041ef3e6470068e8299775477e54c099b3e 100644 (file)
@@ -3011,15 +3011,16 @@ bundle_set(struct ofproto *ofproto_, void *aux,
     size_t i;
     bool ok;
 
+    bundle = bundle_lookup(ofproto, aux);
+
     if (!s) {
-        bundle_destroy(bundle_lookup(ofproto, aux));
+        bundle_destroy(bundle);
         return 0;
     }
 
     ovs_assert(s->n_slaves == 1 || s->bond != NULL);
     ovs_assert((s->lacp != NULL) == (s->lacp_slaves != NULL));
 
-    bundle = bundle_lookup(ofproto, aux);
     if (!bundle) {
         bundle = xmalloc(sizeof *bundle);