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.
Acked-by: Justin Pettit
@@ -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);
}
}
}
