netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] netfilter: nf_tables: fix wrong pointer passed to PTR_ERR()
@ 2023-01-19  7:51 Yang Yingliang
  2023-01-22 16:12 ` Simon Horman
  2023-01-24 13:16 ` Fernando F. Mancera
  0 siblings, 2 replies; 4+ messages in thread
From: Yang Yingliang @ 2023-01-19  7:51 UTC (permalink / raw)
  To: netfilter-devel, coreteam, netdev
  Cc: pablo, kadlec, fw, davem, edumazet, kuba, pabeni, ffmancera

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>
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 974b95dece1d..10264e98978b 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;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-01 11:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-19  7:51 [PATCH net-next] netfilter: nf_tables: fix wrong pointer passed to PTR_ERR() Yang Yingliang
2023-01-22 16:12 ` Simon Horman
2023-01-24 13:16 ` Fernando F. Mancera
2023-02-01 11:17   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).