summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-05-10 13:50:51 -0700
committerBen Pfaff <blp@ovn.org>2018-05-17 08:09:10 -0700
commit92614555eca6f438c6894edad8b36decb5f79b45 (patch)
tree2aca0adabc4eeed4cd76c2b85761bc5e97df1f27 /ofproto
parent481bde499a5dc357a1c3fc96c35dc9b998da3d81 (diff)
downloadopenvswitch-92614555eca6f438c6894edad8b36decb5f79b45.tar.gz
ofproto-dpif-xlate: Fix reference leak in xlate_dp_hash_select_group().
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>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif-xlate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 3cb7b5e35..92c7144fc 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -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);
}
}
}