summaryrefslogtreecommitdiffstats
path: root/drivers/net/plip
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-05-31 12:27:09 -0400
committerDavid S. Miller <davem@davemloft.net>2019-06-02 21:08:36 -0400
commit2638eb8b50cfc16240e0bb080b9afbf541a9b39d (patch)
tree84264a6f50aaedfac6854bef3d5972926d321c10 /drivers/net/plip
parentcb8f1478cea68bc9c9bca8bded9617d9b0b7beb6 (diff)
net: ipv4: provide __rcu annotation for ifa_list
ifa_list is protected by rcu, yet code doesn't reflect this. Add the __rcu annotations and fix up all places that are now reported by sparse. I've done this in the same commit to not add intermediate patches that result in new warnings. Reported-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/plip')
-rw-r--r--drivers/net/plip/plip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/plip/plip.c b/drivers/net/plip/plip.c
index feb92ecd1880..3e3ac2e496a1 100644
--- a/drivers/net/plip/plip.c
+++ b/drivers/net/plip/plip.c
@@ -1012,7 +1012,7 @@ plip_rewrite_address(const struct net_device *dev, struct ethhdr *eth)
1012 in_dev = __in_dev_get_rcu(dev); 1012 in_dev = __in_dev_get_rcu(dev);
1013 if (in_dev) { 1013 if (in_dev) {
1014 /* Any address will do - we take the first */ 1014 /* Any address will do - we take the first */
1015 const struct in_ifaddr *ifa = in_dev->ifa_list; 1015 const struct in_ifaddr *ifa = rcu_dereference(in_dev->ifa_list);
1016 if (ifa) { 1016 if (ifa) {
1017 memcpy(eth->h_source, dev->dev_addr, ETH_ALEN); 1017 memcpy(eth->h_source, dev->dev_addr, ETH_ALEN);
1018 memset(eth->h_dest, 0xfc, 2); 1018 memset(eth->h_dest, 0xfc, 2);
@@ -1107,7 +1107,7 @@ plip_open(struct net_device *dev)
1107 /* Any address will do - we take the first. We already 1107 /* Any address will do - we take the first. We already
1108 have the first two bytes filled with 0xfc, from 1108 have the first two bytes filled with 0xfc, from
1109 plip_init_dev(). */ 1109 plip_init_dev(). */
1110 struct in_ifaddr *ifa=in_dev->ifa_list; 1110 const struct in_ifaddr *ifa = rcu_dereference(in_dev->ifa_list);
1111 if (ifa != NULL) { 1111 if (ifa != NULL) {
1112 memcpy(dev->dev_addr+2, &ifa->ifa_local, 4); 1112 memcpy(dev->dev_addr+2, &ifa->ifa_local, 4);
1113 } 1113 }