diff options
author | Eric Dumazet <edumazet@google.com> | 2024-05-07 18:41:44 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-05-08 18:51:30 -0700 |
commit | 8d8b1a422c4644891e1f8a3ea10b544b65cd0cc6 (patch) | |
tree | 93dbbadb3f9ac8e2befd101adb5d0ad1475c7a05 /drivers/net/ethernet/smsc | |
parent | e2d09e5a1e8fb17a807dc4dce8dbc39d9fea3788 (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/smsc')
-rw-r--r-- | drivers/net/ethernet/smsc/smc91c92_cs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/smsc/smc91c92_cs.c b/drivers/net/ethernet/smsc/smc91c92_cs.c index 29bb19f42de9..86e3ec25df07 100644 --- a/drivers/net/ethernet/smsc/smc91c92_cs.c +++ b/drivers/net/ethernet/smsc/smc91c92_cs.c @@ -1595,7 +1595,7 @@ static int s9k_config(struct net_device *dev, struct ifmap *map) return -EOPNOTSUPP; else if (map->port > 2) return -EINVAL; - dev->if_port = map->port; + WRITE_ONCE(dev->if_port, map->port); netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]); smc_reset(dev); } |