Skip to content

Commit

Permalink
netfilter: nft_immediate: drop chain reference counter on error
Browse files Browse the repository at this point in the history
[ Upstream commit b29be0c ]

In the init path, nft_data_init() bumps the chain reference counter,
decrement it on error by following the error path which calls
nft_data_release() to restore it.

Fixes: 4bedf9e ("netfilter: nf_tables: fix chain binding transaction logic")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ummakynes authored and gregkh committed Jan 10, 2024
1 parent 97cbb82 commit 9824064
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nft_immediate.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static int nft_immediate_init(const struct nft_ctx *ctx,
case NFT_GOTO:
err = nf_tables_bind_chain(ctx, chain);
if (err < 0)
return err;
goto err1;
break;
default:
break;
Expand Down

0 comments on commit 9824064

Please sign in to comment.