netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] netfilter: flowtable: Free block_cb when being deleted
@ 2020-04-12  8:45 Roi Dayan
  2020-04-14 22:54 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Roi Dayan @ 2020-04-12  8:45 UTC (permalink / raw)
  To: netdev, netfilter-devel, pablo, davem
  Cc: Jiri Pirko, Paul Blakey, Oz Shlomo, Roi Dayan

Free block_cb memory when asked to be deleted.

Fixes: 978703f42549 ("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>
---
 net/netfilter/nf_flow_table_core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
index c0cb79495c35..4344e572b7f9 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -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);
-- 
2.8.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] netfilter: flowtable: Free block_cb when being deleted
  2020-04-12  8:45 [PATCH net] netfilter: flowtable: Free block_cb when being deleted Roi Dayan
@ 2020-04-14 22:54 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2020-04-14 22:54 UTC (permalink / raw)
  To: Roi Dayan
  Cc: netdev, netfilter-devel, davem, Jiri Pirko, Paul Blakey, Oz Shlomo

On Sun, Apr 12, 2020 at 11:45:47AM +0300, Roi Dayan wrote:
> Free block_cb memory when asked to be deleted.

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-14 22:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-12  8:45 [PATCH net] netfilter: flowtable: Free block_cb when being deleted Roi Dayan
2020-04-14 22:54 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).