xlate_group_action() takes a reference to the ofgroup and passes it
down to xlate_group_action__(), xlate_select_group(), and finally to
xlate_dp_hash_select_group(), which is supposed to consume it but fails
to do so.  This commit fixes the problem.

Found by inspection.

Signed-off-by: Ben Pfaff <b...@ovn.org>
---
 ofproto/ofproto-dpif-xlate.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 794893a78c67..85fa8b3f7855 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -4390,6 +4390,9 @@ xlate_dp_hash_select_group(struct xlate_ctx *ctx, struct 
group_dpif *group,
         uint64_t param = group->up.props.selection_method_param;
 
         ctx_trigger_recirculate_with_hash(ctx, param >> 32, (uint32_t)param);
+        if (ctx->xin->xcache) {
+            ofproto_group_unref(&group->up);
+        }
     } else {
         uint32_t n_buckets = group->up.n_buckets;
         if (n_buckets) {
@@ -4404,6 +4407,8 @@ xlate_dp_hash_select_group(struct xlate_ctx *ctx, struct 
group_dpif *group,
             if (bucket) {
                 xlate_group_bucket(ctx, bucket, is_last_action);
                 xlate_group_stats(ctx, group, bucket);
+            } else if (ctx->xin->xcache) {
+                ofproto_group_unref(&group->up);
             }
         }
     }
-- 
2.16.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to