summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/xircom
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-05-07 18:41:44 +0000
committerJakub Kicinski <kuba@kernel.org>2024-05-08 18:51:30 -0700
commit8d8b1a422c4644891e1f8a3ea10b544b65cd0cc6 (patch)
tree93dbbadb3f9ac8e2befd101adb5d0ad1475c7a05 /drivers/net/ethernet/xircom
parente2d09e5a1e8fb17a807dc4dce8dbc39d9fea3788 (diff)
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/xircom')
-rw-r--r--drivers/net/ethernet/xircom/xirc2ps_cs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/xircom/xirc2ps_cs.c b/drivers/net/ethernet/xircom/xirc2ps_cs.c
index e9bc38fd2025..a31d5d5e6593 100644
--- a/drivers/net/ethernet/xircom/xirc2ps_cs.c
+++ b/drivers/net/ethernet/xircom/xirc2ps_cs.c
@@ -1366,10 +1366,10 @@ do_config(struct net_device *dev, struct ifmap *map)
return -EINVAL;
if (!map->port) {
local->probe_port = 1;
- dev->if_port = 1;
+ WRITE_ONCE(dev->if_port, 1);
} else {
local->probe_port = 0;
- dev->if_port = map->port;
+ WRITE_ONCE(dev->if_port, map->port);
}
netdev_info(dev, "switching to %s port\n", if_names[dev->if_port]);
do_reset(dev,1); /* not the fine way :-) */