diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-01-02 12:50:12 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-01-08 18:11:05 +0100 |
commit | 0befd061af59c4ba426588930f09eb9ea2475534 (patch) | |
tree | 88f04d0bf5d46804828c7870b0b0d439ac4ac9e2 /net | |
parent | a7f87b47e67e4341f6175cdb80e5c2eaadf30dcb (diff) | |
download | op-kernel-dev-0befd061af59c4ba426588930f09eb9ea2475534.zip op-kernel-dev-0befd061af59c4ba426588930f09eb9ea2475534.tar.gz |
netfilter: nf_tables: remove nft_dereference()
This macro is unnecessary, it just hides details for one single caller.
nfnl_dereference() is just enough.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/nf_tables_api.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 15773a3..fa564da 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -1222,13 +1222,13 @@ static struct nft_stats __percpu *nft_stats_alloc(const struct nlattr *attr) static void nft_chain_stats_replace(struct nft_base_chain *chain, struct nft_stats __percpu *newstats) { + struct nft_stats __percpu *oldstats; + if (newstats == NULL) return; if (chain->stats) { - struct nft_stats __percpu *oldstats = - nft_dereference(chain->stats); - + oldstats = nfnl_dereference(chain->stats, NFNL_SUBSYS_NFTABLES); rcu_assign_pointer(chain->stats, newstats); synchronize_rcu(); free_percpu(oldstats); |