Skip to content

Commit

Permalink
__in_dev_get_rtnl() can use rtnl_dereference()
Browse files Browse the repository at this point in the history
If caller holds RTNL, we dont need a memory barrier
(smp_read_barrier_depends) included in rcu_dereference().

Just use rtnl_dereference() to properly document the assertions.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 6, 2010
1 parent da2033c commit 06a9701
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/inetdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static inline struct in_device *in_dev_get(const struct net_device *dev)

static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
{
return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held());
return rtnl_dereference(dev->ip_ptr);
}

extern void in_dev_finish_destroy(struct in_device *idev);
Expand Down

0 comments on commit 06a9701

Please sign in to comment.