2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

dpif-netdev: Fix memory leak.

In dpif_netdev_flow_del() and dp_netdev_port_input(), the
referenced 'netdev_flow' is not un-referenced.  This causes
the leak of the struct's memory.

This commit fixes the above issue by calling dp_netdev_flow_unref()
after using the reference.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Alex Wang
2014-02-21 14:03:51 -08:00
parent 3754832be4
commit 71c24bb0f8

View File

@@ -1295,6 +1295,7 @@ dpif_netdev_flow_del(struct dpif *dpif, const struct dpif_flow_del *del)
ovs_mutex_unlock(&netdev_flow->mutex);
}
dp_netdev_remove_flow(dp, netdev_flow);
dp_netdev_flow_unref(netdev_flow);
} else {
error = ENOENT;
}
@@ -1706,6 +1707,7 @@ dp_netdev_port_input(struct dp_netdev *dp, struct ofpbuf *packet,
dp_netdev_execute_actions(dp, &key, packet, md,
actions->actions, actions->size);
dp_netdev_actions_unref(actions);
dp_netdev_flow_unref(netdev_flow);
ovsthread_counter_inc(dp->n_hit, 1);
} else {
ovsthread_counter_inc(dp->n_missed, 1);