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

net: remove dev_base_lock from do_setlink()



We hold RTNL here, and dev->link_mode readers already
are using READ_ONCE().

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6a2968ee
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2961,11 +2961,9 @@ static int do_setlink(const struct sk_buff *skb,
	if (tb[IFLA_LINKMODE]) {
		unsigned char value = nla_get_u8(tb[IFLA_LINKMODE]);

		write_lock(&dev_base_lock);
		if (dev->link_mode ^ value)
			status |= DO_SETLINK_NOTIFY;
		WRITE_ONCE(dev->link_mode, value);
		write_unlock(&dev_base_lock);
	}

	if (tb[IFLA_VFINFO_LIST]) {