]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ipv4: nexthop: Remove unnecessary rtnl_dereference()
authorIdo Schimmel <idosch@nvidia.com>
Wed, 26 Aug 2020 16:48:53 +0000 (19:48 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Aug 2020 23:00:51 +0000 (16:00 -0700)
The pointer is not RCU protected, so remove the unnecessary
rtnl_dereference(). This suppresses the following warning:

net/ipv4/nexthop.c:1101:24: error: incompatible types in comparison expression (different address spaces):
net/ipv4/nexthop.c:1101:24:    struct rb_node [noderef] __rcu *
net/ipv4/nexthop.c:1101:24:    struct rb_node *

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/nexthop.c

index 0823643a7decbb61fe15879c329c14aa58d631d0..1b736e3e1baa66b8ad8dc67a7b8cf7edf43ae7cc 100644 (file)
@@ -1098,7 +1098,7 @@ static int insert_nexthop(struct net *net, struct nexthop *new_nh,
        while (1) {
                struct nexthop *nh;
 
-               next = rtnl_dereference(*pp);
+               next = *pp;
                if (!next)
                        break;