diff options
author | Florian Westphal <fw@strlen.de> | 2019-05-31 18:27:09 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-02 18:08:36 -0700 |
commit | 2638eb8b50cfc16240e0bb080b9afbf541a9b39d (patch) | |
tree | 84264a6f50aaedfac6854bef3d5972926d321c10 /drivers/staging/isdn | |
parent | cb8f1478cea68bc9c9bca8bded9617d9b0b7beb6 (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/staging/isdn')
-rw-r--r-- | drivers/staging/isdn/hysdn/hysdn_net.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/isdn/hysdn/hysdn_net.c b/drivers/staging/isdn/hysdn/hysdn_net.c index 8e9c34f33d86..bea37ae30ebb 100644 --- a/drivers/staging/isdn/hysdn/hysdn_net.c +++ b/drivers/staging/isdn/hysdn/hysdn_net.c @@ -70,9 +70,13 @@ net_open(struct net_device *dev) for (i = 0; i < ETH_ALEN; i++) dev->dev_addr[i] = 0xfc; if ((in_dev = dev->ip_ptr) != NULL) { - struct in_ifaddr *ifa = in_dev->ifa_list; + const struct in_ifaddr *ifa; + + rcu_read_lock(); + ifa = rcu_dereference(in_dev->ifa_list); if (ifa != NULL) memcpy(dev->dev_addr + (ETH_ALEN - sizeof(ifa->ifa_local)), &ifa->ifa_local, sizeof(ifa->ifa_local)); + rcu_read_unlock(); } } else memcpy(dev->dev_addr, card->mac_addr, ETH_ALEN); |