Skip to content

Commit 0be9087

Browse files
Florian Westphalummakynes
Florian Westphal
authored andcommitted
netfilter: nf_tables: pass nft_table to destroy function
No functional change intended. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 551b388 commit 0be9087

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

net/netfilter/nf_tables_api.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -1656,15 +1656,15 @@ static int nf_tables_deltable(struct sk_buff *skb, const struct nfnl_info *info,
16561656
return nft_flush_table(&ctx);
16571657
}
16581658

1659-
static void nf_tables_table_destroy(struct nft_ctx *ctx)
1659+
static void nf_tables_table_destroy(struct nft_table *table)
16601660
{
1661-
if (WARN_ON(ctx->table->use > 0))
1661+
if (WARN_ON(table->use > 0))
16621662
return;
16631663

1664-
rhltable_destroy(&ctx->table->chains_ht);
1665-
kfree(ctx->table->name);
1666-
kfree(ctx->table->udata);
1667-
kfree(ctx->table);
1664+
rhltable_destroy(&table->chains_ht);
1665+
kfree(table->name);
1666+
kfree(table->udata);
1667+
kfree(table);
16681668
}
16691669

16701670
void nft_register_chain_type(const struct nft_chain_type *ctype)
@@ -9521,7 +9521,7 @@ static void nft_commit_release(struct nft_trans *trans)
95219521
switch (trans->msg_type) {
95229522
case NFT_MSG_DELTABLE:
95239523
case NFT_MSG_DESTROYTABLE:
9524-
nf_tables_table_destroy(&trans->ctx);
9524+
nf_tables_table_destroy(trans->ctx.table);
95259525
break;
95269526
case NFT_MSG_NEWCHAIN:
95279527
free_percpu(nft_trans_chain_stats(trans));
@@ -10518,7 +10518,7 @@ static void nf_tables_abort_release(struct nft_trans *trans)
1051810518
{
1051910519
switch (trans->msg_type) {
1052010520
case NFT_MSG_NEWTABLE:
10521-
nf_tables_table_destroy(&trans->ctx);
10521+
nf_tables_table_destroy(trans->ctx.table);
1052210522
break;
1052310523
case NFT_MSG_NEWCHAIN:
1052410524
if (nft_trans_chain_update(trans))
@@ -11490,7 +11490,7 @@ static void __nft_release_table(struct net *net, struct nft_table *table)
1149011490
nft_use_dec(&table->use);
1149111491
nf_tables_chain_destroy(chain);
1149211492
}
11493-
nf_tables_table_destroy(&ctx);
11493+
nf_tables_table_destroy(table);
1149411494
}
1149511495

1149611496
static void __nft_release_tables(struct net *net)

0 commit comments

Comments
 (0)