Skip to content

Commit 6f6e9c9

Browse files
committed
netfilter: nf_tables: fix wrong pointer passed to PTR_ERR()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1925492 Upstream Status: commit 1fb7696 commit 1fb7696 Author: Yang Yingliang <yangyingliang@huawei.com> Date: Thu Jan 19 15:51:25 2023 +0800 netfilter: nf_tables: fix wrong pointer passed to PTR_ERR() It should be 'chain' passed to PTR_ERR() in the error path after calling nft_chain_lookup() in nf_tables_delrule(). Fixes: f80a612 ("netfilter: nf_tables: add support to destroy operation") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Acked-by: Fernando Fernandez Mancera <ffmancera@riseup.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Phil Sutter <psutter@redhat.com>
1 parent f6dad62 commit 6f6e9c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3652,7 +3652,7 @@ static int nf_tables_delrule(struct sk_buff *skb, const struct nfnl_info *info,
36523652
chain = nft_chain_lookup(net, table, nla[NFTA_RULE_CHAIN],
36533653
genmask);
36543654
if (IS_ERR(chain)) {
3655-
if (PTR_ERR(rule) == -ENOENT &&
3655+
if (PTR_ERR(chain) == -ENOENT &&
36563656
NFNL_MSG_TYPE(info->nlh->nlmsg_type) == NFT_MSG_DESTROYRULE)
36573657
return 0;
36583658

0 commit comments

Comments
 (0)