Commit
401aa90e33be (ofproto: Fix memory leak in flow deletion.) fixed
the memory leak when a rule is deleted, but failed to do the same when
all rules in a bridge are deleted just before the bridge itself is
deleted.
This patch adds the necessary unref to ofproto_rule_delete().
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs_mutex_lock(&ofproto_mutex);
oftable_remove_rule(rule);
ofproto->ofproto_class->rule_delete(rule);
+ ofproto_rule_unref(rule);
ovs_mutex_unlock(&ofproto_mutex);
}
if (next_table == rule->table_id) {
classifier_defer(cls);
}
- classifier_remove(cls, &rule->cr);
+ if (!classifier_remove(cls, &rule->cr)) {
+ OVS_NOT_REACHED();
+ }
if (next_table != rule->table_id) {
classifier_publish(cls);
}
if (classifier_remove(cls, &rule->cr)) {
ofproto_rule_remove__(rule->ofproto, rule);
+ } else {
+ OVS_NOT_REACHED();
}
}
\f