diff options
author | Eric Dumazet <edumazet@google.com> | 2014-07-15 06:56:54 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-15 17:49:41 -0700 |
commit | c2646b593eb127adc50e108649e4d34144e14c6c (patch) | |
tree | f4d5f0021ff65b54e41c32954d0bb6b940c10196 /drivers/net/bonding/bond_sysfs.c | |
parent | e965f8049460569bab12fe7bb5381bb2279712e2 (diff) | |
download | blackbird-op-linux-c2646b593eb127adc50e108649e4d34144e14c6c.tar.gz blackbird-op-linux-c2646b593eb127adc50e108649e4d34144e14c6c.zip |
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>
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r-- | drivers/net/bonding/bond_sysfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index daed52f68ce1..98db8edd9c75 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -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); |