Skip to content

Commit

Permalink
netfilter: flowtable: Free block_cb when being deleted
Browse files Browse the repository at this point in the history
Free block_cb memory when asked to be deleted.

Fixes: 978703f ("netfilter: flowtable: Add API for registering to flow table events")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Roi Dayan authored and Pablo Neira Ayuso committed Apr 14, 2020
1 parent 82f3527 commit bc8e713
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/netfilter/nf_flow_table_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,12 @@ void nf_flow_table_offload_del_cb(struct nf_flowtable *flow_table,

down_write(&flow_table->flow_block_lock);
block_cb = flow_block_cb_lookup(block, cb, cb_priv);
if (block_cb)
if (block_cb) {
list_del(&block_cb->list);
else
flow_block_cb_free(block_cb);
} else {
WARN_ON(true);
}
up_write(&flow_table->flow_block_lock);
}
EXPORT_SYMBOL_GPL(nf_flow_table_offload_del_cb);
Expand Down

0 comments on commit bc8e713

Please sign in to comment.