From: Gao feng <gaofeng@cn.fujitsu.com>
To: netfilter-devel@vger.kernel.org
Cc: Gao feng <gaofeng@cn.fujitsu.com>
Subject: [PATCH] nfnetlink: use rcu_assign_pointer in nfnetlink_subsys_unregister
Date: Tue, 8 Oct 2013 18:04:08 +0800 [thread overview]
Message-ID: <1381226648-10959-1-git-send-email-gaofeng@cn.fujitsu.com> (raw)
Though I don't face an oops, but it is more safer to
set table's subsys through rcu_assign_pointer.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
net/netfilter/nfnetlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 572d87d..3cd2fe6 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -78,7 +78,7 @@ EXPORT_SYMBOL_GPL(nfnetlink_subsys_register);
int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n)
{
nfnl_lock(n->subsys_id);
- table[n->subsys_id].subsys = NULL;
+ rcu_assign_pointer(table[n->subsys_id].subsys, NULL);
nfnl_unlock(n->subsys_id);
synchronize_rcu();
return 0;
--
1.8.3.1
next reply other threads:[~2013-10-08 10:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 10:04 Gao feng [this message]
2013-10-08 15:23 ` [PATCH] nfnetlink: use rcu_assign_pointer in nfnetlink_subsys_unregister Eric Dumazet
2013-10-09 3:28 ` Gao feng
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=1381226648-10959-1-git-send-email-gaofeng@cn.fujitsu.com \
--to=gaofeng@cn.fujitsu.com \
--cc=netfilter-devel@vger.kernel.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).