Commit 043d2acf authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_tables: drop module reference after updating chain

Otherwise the module reference counter is leaked.

Fixes b9703ed4 ("netfilter: nf_tables: support for adding new devices to an existing netdev chain")
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent e26d3009
......@@ -2667,6 +2667,8 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy,
nft_trans_basechain(trans) = basechain;
INIT_LIST_HEAD(&nft_trans_chain_hooks(trans));
list_splice(&hook.list, &nft_trans_chain_hooks(trans));
if (nla[NFTA_CHAIN_HOOK])
module_put(hook.type->owner);
nft_trans_commit_list_add_tail(ctx->net, trans);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment