]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ipv6: __ipv6_dev_get_saddr() rcu conversion
authorEric Dumazet <edumazet@google.com>
Sun, 8 Oct 2017 02:30:27 +0000 (19:30 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Oct 2017 04:16:30 +0000 (21:16 -0700)
Callers hold rcu_read_lock(), so we do not need
the rcu_read_lock()/rcu_read_unlock() pair.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/addrconf.c

index ea63442209bf268f1a19b5e014cb8c7e34fd40b4..20c3ca777529fc49ebf749ca6f7d8c2451258d55 100644 (file)
@@ -1558,8 +1558,7 @@ static int __ipv6_dev_get_saddr(struct net *net,
 {
        struct ipv6_saddr_score *score = &scores[1 - hiscore_idx], *hiscore = &scores[hiscore_idx];
 
-       read_lock_bh(&idev->lock);
-       list_for_each_entry(score->ifa, &idev->addr_list, if_list) {
+       list_for_each_entry_rcu(score->ifa, &idev->addr_list, if_list) {
                int i;
 
                /*
@@ -1625,7 +1624,6 @@ static int __ipv6_dev_get_saddr(struct net *net,
                }
        }
 out:
-       read_unlock_bh(&idev->lock);
        return hiscore_idx;
 }