ipv6: Annotate change of locking mechanism for np->opt
[deliverable/linux.git] / include / net / ipv6.h
index 6570f379aba2eb744b0e8522349f0612b01b6814..f3c9857c645dee91a8a850ed5639ae5894dcff73 100644 (file)
@@ -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;
 }
This page took 0.027175 seconds and 5 git commands to generate.