diff mbox series

[net-next,3/7] ipv4: nexthop: Remove unnecessary rtnl_dereference()

Message ID 20200826164857.1029764-4-idosch@idosch.org
State New
Headers show
Series [net-next,1/7] ipv4: nexthop: Reduce allocation size of 'struct nh_group' | expand

Commit Message

Ido Schimmel Aug. 26, 2020, 4:48 p.m. UTC
From: Ido Schimmel <idosch@nvidia.com>

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>
---
 net/ipv4/nexthop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index 0823643a7dec..1b736e3e1baa 100644
--- a/net/ipv4/nexthop.c
+++ b/net/ipv4/nexthop.c
@@ -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;