mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
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>
This commit is contained in:
parent
cb8f1478ce
commit
2638eb8b50
15 changed files with 135 additions and 82 deletions
|
@ -696,16 +696,22 @@ int netpoll_setup(struct netpoll *np)
|
|||
|
||||
if (!np->local_ip.ip) {
|
||||
if (!np->ipv6) {
|
||||
in_dev = __in_dev_get_rtnl(ndev);
|
||||
const struct in_ifaddr *ifa;
|
||||
|
||||
if (!in_dev || !in_dev->ifa_list) {
|
||||
in_dev = __in_dev_get_rtnl(ndev);
|
||||
if (!in_dev)
|
||||
goto put_noaddr;
|
||||
|
||||
ifa = rtnl_dereference(in_dev->ifa_list);
|
||||
if (!ifa) {
|
||||
put_noaddr:
|
||||
np_err(np, "no IP address for %s, aborting\n",
|
||||
np->dev_name);
|
||||
err = -EDESTADDRREQ;
|
||||
goto put;
|
||||
}
|
||||
|
||||
np->local_ip.ip = in_dev->ifa_list->ifa_local;
|
||||
np->local_ip.ip = ifa->ifa_local;
|
||||
np_info(np, "local IP %pI4\n", &np->local_ip.ip);
|
||||
} else {
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue