From: wenxu@ucloud.cn
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH nf 1/3] netfilter: nf_tables: fix rule release in err path
Date: Wed, 18 Dec 2019 22:59:11 +0800 [thread overview]
Message-ID: <1576681153-10578-2-git-send-email-wenxu@ucloud.cn> (raw)
In-Reply-To: <1576681153-10578-1-git-send-email-wenxu@ucloud.cn>
From: wenxu <wenxu@ucloud.cn>
The err2 failed path in nf_tables_newrule fail err2 should only destory this new rule
without deactivate it. Because the rule is not been activated.
Signed-off-by: wenxu <wenxu@ucloud.cn>
---
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 a8caf73..27e6a6f 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -3130,7 +3130,7 @@ static int nf_tables_newrule(struct net *net, struct sock *nlsk,
return 0;
err2:
- nf_tables_rule_release(&ctx, rule);
+ nf_tables_rule_destroy(&ctx, rule);
err1:
for (i = 0; i < n; i++) {
if (info[i].ops) {
--
1.8.3.1
next prev parent reply other threads:[~2019-12-18 14:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 14:59 [PATCH nf 0/3] netfilter: nf_tables: fix use counter for rule wenxu
2019-12-18 14:59 ` wenxu [this message]
2019-12-19 23:43 ` [PATCH nf 1/3] netfilter: nf_tables: fix rule release in err path Pablo Neira Ayuso
2019-12-18 14:59 ` [PATCH nf 2/3] netfilter: nf_tables: fix miss activate operation in the wenxu
2019-12-19 23:55 ` Pablo Neira Ayuso
2019-12-20 3:42 ` wenxu
2019-12-20 9:04 ` Pablo Neira Ayuso
2019-12-18 14:59 ` [PATCH nf 3/3] netfilter: nf_tables: fix miss dec set use counter in the nf_tables_destroy_set wenxu
2019-12-19 23:56 ` Pablo Neira Ayuso
2019-12-20 9:12 ` wenxu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1576681153-10578-2-git-send-email-wenxu@ucloud.cn \
--to=wenxu@ucloud.cn \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).