bonding: use rcu_access_pointer() in bonding_show_mii_status()

curr_active_slave is rcu protected, and bonding_show_mii_status() only
wants to check if pointer is NULL or not.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Veaceslav Falico <vfalico@gmail.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet 2014-07-15 06:56:54 -07:00 committed by David S. Miller
parent e965f80494
commit c2646b593e
1 changed files with 2 additions and 1 deletions

View File

@ -492,8 +492,9 @@ static ssize_t bonding_show_mii_status(struct device *d,
char *buf)
{
struct bonding *bond = to_bond(d);
bool active = !!rcu_access_pointer(bond->curr_active_slave);
return sprintf(buf, "%s\n", bond->curr_active_slave ? "up" : "down");
return sprintf(buf, "%s\n", active ? "up" : "down");
}
static DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL);