aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_tables_api.c
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2023-01-19 15:51:25 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2023-02-01 12:18:51 +0100
commit1fb7696ac6c3ac470dd002e639af80e7e170b25f (patch)
tree71942f76c94f81111dd3ac610f460bf023f48333 /net/netfilter/nf_tables_api.c
parentdac7f50a45216d652887fb92d6cd3b7ca7f006ea (diff)
downloadlinux-1fb7696ac6c3ac470dd002e639af80e7e170b25f.tar.gz
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: f80a612dd77c ("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>
Diffstat (limited to 'net/netfilter/nf_tables_api.c')
-rw-r--r--net/netfilter/nf_tables_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 2abf473c8f6729..d73edbd4eec450 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -3724,7 +3724,7 @@ static int nf_tables_delrule(struct sk_buff *skb, const struct nfnl_info *info,
chain = nft_chain_lookup(net, table, nla[NFTA_RULE_CHAIN],
genmask);
if (IS_ERR(chain)) {
- if (PTR_ERR(rule) == -ENOENT &&
+ if (PTR_ERR(chain) == -ENOENT &&
NFNL_MSG_TYPE(info->nlh->nlmsg_type) == NFT_MSG_DESTROYRULE)
return 0;