dev: annotate accesses to dev->link

Following patch will read dev->link locklessly,
annotate the write from do_setlink().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet 2024-02-13 06:32:35 +00:00 committed by David S. Miller
parent f694eee9e1
commit a6473fe9b6

View File

@ -2956,7 +2956,7 @@ static int do_setlink(const struct sk_buff *skb,
write_lock(&dev_base_lock);
if (dev->link_mode ^ value)
status |= DO_SETLINK_NOTIFY;
dev->link_mode = value;
WRITE_ONCE(dev->link_mode, value);
write_unlock(&dev_base_lock);
}