summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/route.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6aee412a68bd..59670fafcd26 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2872,12 +2872,13 @@ int fib_dump_info_fnhe(struct sk_buff *skb, struct netlink_callback *cb,
if (nhc->nhc_flags & RTNH_F_DEAD)
continue;
+ rcu_read_lock();
bucket = rcu_dereference(nhc->nhc_exceptions);
- if (!bucket)
- continue;
-
- err = fnhe_dump_bucket(net, skb, cb, table_id, bucket, genid,
- fa_index, fa_start);
+ err = 0;
+ if (bucket)
+ err = fnhe_dump_bucket(net, skb, cb, table_id, bucket,
+ genid, fa_index, fa_start);
+ rcu_read_unlock();
if (err)
return err;
}