diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-11-15 18:43:59 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-11-15 18:43:59 +0100 |
commit | eb733162ae4f69b93f7c08012e6e239f31796de8 (patch) | |
tree | 32a6ceba0bda60bf45bcb415d1fe6841a98eab11 /net/ipv4/netfilter/nf_nat_core.c | |
parent | be9e9163afcfc3137e7c6377cb0c7b406318fde0 (diff) | |
download | kernel_samsung_smdk4412-eb733162ae4f69b93f7c08012e6e239f31796de8.tar.gz kernel_samsung_smdk4412-eb733162ae4f69b93f7c08012e6e239f31796de8.tar.bz2 kernel_samsung_smdk4412-eb733162ae4f69b93f7c08012e6e239f31796de8.zip |
netfilter: add __rcu annotations
Use helpers to reduce number of sparse warnings
(CONFIG_SPARSE_RCU_POINTER=y)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4/netfilter/nf_nat_core.c')
-rw-r--r-- | net/ipv4/netfilter/nf_nat_core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c index ab877acb22a..eb55835a02c 100644 --- a/net/ipv4/netfilter/nf_nat_core.c +++ b/net/ipv4/netfilter/nf_nat_core.c @@ -502,7 +502,10 @@ int nf_nat_protocol_register(const struct nf_nat_protocol *proto) int ret = 0; spin_lock_bh(&nf_nat_lock); - if (nf_nat_protos[proto->protonum] != &nf_nat_unknown_protocol) { + if (rcu_dereference_protected( + nf_nat_protos[proto->protonum], + lockdep_is_held(&nf_nat_lock) + ) != &nf_nat_unknown_protocol) { ret = -EBUSY; goto out; } |