diff options
author | Eric Dumazet <edumazet@google.com> | 2024-05-06 12:28:12 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-05-08 01:19:14 +0200 |
commit | 1eb2cded45b35816085c1f962933c187d970f9dc (patch) | |
tree | 27a26692748d3c69fcd896a10db9bc89c1eb54b5 /drivers/net/usb/aqc111.c | |
parent | net: dccp: Fix ccid2_rtt_estimator() kernel-doc (diff) | |
download | linux-1eb2cded45b35816085c1f962933c187d970f9dc.tar.xz linux-1eb2cded45b35816085c1f962933c187d970f9dc.zip |
net: annotate writes on dev->mtu from ndo_change_mtu()
Simon reported that ndo_change_mtu() methods were never
updated to use WRITE_ONCE(dev->mtu, new_mtu) as hinted
in commit 501a90c94510 ("inet: protect against too small
mtu values.")
We read dev->mtu without holding RTNL in many places,
with READ_ONCE() annotations.
It is time to take care of ndo_change_mtu() methods
to use corresponding WRITE_ONCE()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Simon Horman <horms@kernel.org>
Closes: https://lore.kernel.org/netdev/20240505144608.GB67882@kernel.org/
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Shannon Nelson <shannon.nelson@amd.com>
Link: https://lore.kernel.org/r/20240506102812.3025432-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/usb/aqc111.c')
-rw-r--r-- | drivers/net/usb/aqc111.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 7b8afa589a53..74571c8e7691 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -424,7 +424,7 @@ static int aqc111_change_mtu(struct net_device *net, int new_mtu) u16 reg16 = 0; u8 buf[5]; - net->mtu = new_mtu; + WRITE_ONCE(net->mtu, new_mtu); dev->hard_mtu = net->mtu + net->hard_header_len; aqc111_read16_cmd(dev, AQ_ACCESS_MAC, SFR_MEDIUM_STATUS_MODE, |