From: Eric Dumazet Date: Tue, 13 Feb 2024 06:32:35 +0000 (+0000) Subject: dev: annotate accesses to dev->link X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a6473fe9b623f6667af72d972b87cd9a5ff87e21;p=linux.git dev: annotate accesses to dev->link Following patch will read dev->link locklessly, annotate the write from do_setlink(). Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 6f1c5537e8421..fd47a4422a51d 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -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); }