提交 c2646b59 编写于 作者: E Eric Dumazet 提交者: David S. Miller

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: NEric Dumazet <edumazet@google.com>
Acked-by: NVeaceslav Falico <vfalico@gmail.com>
Reviewed-by: NNikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e965f804
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册