[ovs-dev] [PATCH] put bundle_lookup ahead to simplify the code
Duan Jiong
djduanjiong at gmail.com
Fri Sep 8 01:51:38 UTC 2017
>From ba48275f8bb30ed2888c16426726ee9cb3407cd1 Mon Sep 17 00:00:00 2001
From: Duan Jiong <djduanjiong at gmail.com>
Date: Fri, 8 Sep 2017 09:48:59 +0800
Subject: [PATCH] put bundle_lookup ahead to simplify the code
Signed-off-by: Duan Jiong <djduanjiong at gmail.com>
---
ofproto/ofproto-dpif.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 1a8e829..293780f 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -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);
--
1.9.1
More information about the dev
mailing list