projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e965f80
)
bonding: use rcu_access_pointer() in bonding_show_mii_status()
author
Eric Dumazet
<
[email protected]
>
Tue, 15 Jul 2014 13:56:54 +0000
(06:56 -0700)
committer
David S. Miller
<
[email protected]
>
Wed, 16 Jul 2014 00:49:41 +0000
(17:49 -0700)
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 <
[email protected]
>
Acked-by: Veaceslav Falico <
[email protected]
>
Reviewed-by: Nikolay Aleksandrov <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/bonding/bond_sysfs.c
patch
|
blob
|
history
diff --git
a/drivers/net/bonding/bond_sysfs.c
b/drivers/net/bonding/bond_sysfs.c
index daed52f68ce1614ec94772ad1628f09417e04bfe..98db8edd9c755c55d04a26b0b40143ba80d15a55 100644
(file)
--- 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_sla
ve ? "up" : "down");
+ return sprintf(buf, "%s\n",
acti
ve ? "up" : "down");
}
static DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL);