Skip to content

Commit

Permalink
rtnetlink: rtnl_have_link_slave_info doesn't need rtnl
Browse files Browse the repository at this point in the history
it can be switched to rcu.

Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Sep 28, 2017
1 parent b1e66b9 commit 4c82a95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,15 @@ static size_t rtnl_link_get_af_size(const struct net_device *dev,
static bool rtnl_have_link_slave_info(const struct net_device *dev)
{
struct net_device *master_dev;
bool ret = false;

master_dev = netdev_master_upper_dev_get((struct net_device *) dev);
rcu_read_lock();

master_dev = netdev_master_upper_dev_get_rcu((struct net_device *)dev);
if (master_dev && master_dev->rtnl_link_ops)
return true;
return false;
ret = true;
rcu_read_unlock();
return ret;
}

static int rtnl_link_slave_info_fill(struct sk_buff *skb,
Expand Down

0 comments on commit 4c82a95

Please sign in to comment.