diff options
author | Benjamin Poirier <bpoirier@suse.com> | 2016-02-17 16:20:33 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-18 15:27:25 -0500 |
commit | e550785c30f639b3cc6ca70c489a6463ff298453 (patch) | |
tree | aac67de77d10b09b2a4cc00ba7b6abc1372e9106 /include/net/ipv6.h | |
parent | f0a404505c7310ca1b59c49516360ca6baa5ef74 (diff) | |
download | linux-e550785c30f639b3cc6ca70c489a6463ff298453.tar.bz2 |
ipv6: Annotate change of locking mechanism for np->opt
follows up commit 45f6fad84cc3 ("ipv6: add complete rcu protection around
np->opt") which added mixed rcu/refcount protection to np->opt.
Given the current implementation of rcu_pointer_handoff(), this has no
effect at runtime.
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r-- | include/net/ipv6.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 6570f379aba2..f3c9857c645d 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -259,8 +259,12 @@ static inline struct ipv6_txoptions *txopt_get(const struct ipv6_pinfo *np) rcu_read_lock(); opt = rcu_dereference(np->opt); - if (opt && !atomic_inc_not_zero(&opt->refcnt)) - opt = NULL; + if (opt) { + if (!atomic_inc_not_zero(&opt->refcnt)) + opt = NULL; + else + opt = rcu_pointer_handoff(opt); + } rcu_read_unlock(); return opt; } |