use ovsrcu_set first then use ovsrcu_postpone

CC: Ben Pfaff <b...@nicira.com>
Fixes: 18080541d276 (\classifier: Add support for conjunctive matches.\)

Acked-by: Yanqin Wei <yanqin....@arm.com>
Signed-off-by: Linhaifeng <haifeng....@huawei.com>
---
 lib/classifier.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/classifier.c b/lib/classifier.c
index f2c3497c2..6bff76e07 100644
--- a/lib/classifier.c
+++ b/lib/classifier.c
@@ -249,11 +249,11 @@ cls_rule_set_conjunctions(struct cls_rule *cr,
     unsigned int old_n = old ? old->n : 0;
 
     if (old_n != n || (n && memcmp(old_conj, conj, n * sizeof *conj))) {
+        ovsrcu_set(&match->conj_set,
+                   cls_conjunction_set_alloc(match, conj, n));
         if (old) {
             ovsrcu_postpone(free, old);
         }
-        ovsrcu_set(&match->conj_set,
-                   cls_conjunction_set_alloc(match, conj, n));
     }
 }
 
-- 
2.21.0.windows.1
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to