diff options
author | Eric Dumazet <edumazet@google.com> | 2024-05-07 20:41:44 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-05-09 03:51:30 +0200 |
commit | 8d8b1a422c4644891e1f8a3ea10b544b65cd0cc6 (patch) | |
tree | 93dbbadb3f9ac8e2befd101adb5d0ad1475c7a05 /drivers/net/ethernet/sis | |
parent | net: dst_cache: minor optimization in dst_cache_set_ip6() (diff) | |
download | linux-8d8b1a422c4644891e1f8a3ea10b544b65cd0cc6.tar.xz linux-8d8b1a422c4644891e1f8a3ea10b544b65cd0cc6.zip |
net: annotate data-races around dev->if_port
Various ndo_set_config() methods can change dev->if_port
dev->if_port is going to be read locklessly from
rtnl_fill_link_ifmap().
Add corresponding WRITE_ONCE() on writer sides.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240507184144.1230469-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/sis')
-rw-r--r-- | drivers/net/ethernet/sis/sis900.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c index cb7fec226cab..85b850372efe 100644 --- a/drivers/net/ethernet/sis/sis900.c +++ b/drivers/net/ethernet/sis/sis900.c @@ -2273,7 +2273,7 @@ static int sis900_set_config(struct net_device *dev, struct ifmap *map) * (which seems to be different from the ifport(pcmcia) definition) */ switch(map->port){ case IF_PORT_UNKNOWN: /* use auto here */ - dev->if_port = map->port; + WRITE_ONCE(dev->if_port, map->port); /* we are going to change the media type, so the Link * will be temporary down and we need to reflect that * here. When the Link comes up again, it will be @@ -2294,7 +2294,7 @@ static int sis900_set_config(struct net_device *dev, struct ifmap *map) break; case IF_PORT_10BASET: /* 10BaseT */ - dev->if_port = map->port; + WRITE_ONCE(dev->if_port, map->port); /* we are going to change the media type, so the Link * will be temporary down and we need to reflect that @@ -2315,7 +2315,7 @@ static int sis900_set_config(struct net_device *dev, struct ifmap *map) case IF_PORT_100BASET: /* 100BaseT */ case IF_PORT_100BASETX: /* 100BaseTx */ - dev->if_port = map->port; + WRITE_ONCE(dev->if_port, map->port); /* we are going to change the media type, so the Link * will be temporary down and we need to reflect that |