]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ofproto-dpif-xlate: Fix reference leak in xlate_dp_hash_select_group().
authorBen Pfaff <blp@ovn.org>
Thu, 10 May 2018 20:50:51 +0000 (13:50 -0700)
committerBen Pfaff <blp@ovn.org>
Thu, 17 May 2018 15:09:10 +0000 (08:09 -0700)
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 <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
ofproto/ofproto-dpif-xlate.c

index 3cb7b5e352777509f26ac60291edc1e03c81edba..92c7144fc0838d3e58af00125d3e3c1172e977c7 100644 (file)
@@ -4394,6 +4394,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) {
@@ -4408,6 +4411,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);
             }
         }
     }