aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 20b548ea5a0a..b1a08374088b 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -2394,22 +2394,25 @@ batadv_bla_backbone_dump_bucket(struct sk_buff *msg, u32 portid, u32 seq,
2394{ 2394{
2395 struct batadv_bla_backbone_gw *backbone_gw; 2395 struct batadv_bla_backbone_gw *backbone_gw;
2396 int idx = 0; 2396 int idx = 0;
2397 int ret = 0;
2397 2398
2398 rcu_read_lock(); 2399 rcu_read_lock();
2399 hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) { 2400 hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) {
2400 if (idx++ < *idx_skip) 2401 if (idx++ < *idx_skip)
2401 continue; 2402 continue;
2402 if (batadv_bla_backbone_dump_entry(msg, portid, seq, 2403
2403 primary_if, backbone_gw)) { 2404 ret = batadv_bla_backbone_dump_entry(msg, portid, seq,
2405 primary_if, backbone_gw);
2406 if (ret) {
2404 *idx_skip = idx - 1; 2407 *idx_skip = idx - 1;
2405 goto unlock; 2408 goto unlock;
2406 } 2409 }
2407 } 2410 }
2408 2411
2409 *idx_skip = idx; 2412 *idx_skip = 0;
2410unlock: 2413unlock:
2411 rcu_read_unlock(); 2414 rcu_read_unlock();
2412 return 0; 2415 return ret;
2413} 2416}
2414 2417
2415/** 2418/**