Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2646b59 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarVeaceslav Falico <vfalico@gmail.com>
Reviewed-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e965f804
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);