diff options
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.c')
-rw-r--r-- | net/batman-adv/bridge_loop_avoidance.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index fad47853ad3c..b1a08374088b 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c | |||
@@ -2161,22 +2161,25 @@ batadv_bla_claim_dump_bucket(struct sk_buff *msg, u32 portid, u32 seq, | |||
2161 | { | 2161 | { |
2162 | struct batadv_bla_claim *claim; | 2162 | struct batadv_bla_claim *claim; |
2163 | int idx = 0; | 2163 | int idx = 0; |
2164 | int ret = 0; | ||
2164 | 2165 | ||
2165 | rcu_read_lock(); | 2166 | rcu_read_lock(); |
2166 | hlist_for_each_entry_rcu(claim, head, hash_entry) { | 2167 | hlist_for_each_entry_rcu(claim, head, hash_entry) { |
2167 | if (idx++ < *idx_skip) | 2168 | if (idx++ < *idx_skip) |
2168 | continue; | 2169 | continue; |
2169 | if (batadv_bla_claim_dump_entry(msg, portid, seq, | 2170 | |
2170 | primary_if, claim)) { | 2171 | ret = batadv_bla_claim_dump_entry(msg, portid, seq, |
2172 | primary_if, claim); | ||
2173 | if (ret) { | ||
2171 | *idx_skip = idx - 1; | 2174 | *idx_skip = idx - 1; |
2172 | goto unlock; | 2175 | goto unlock; |
2173 | } | 2176 | } |
2174 | } | 2177 | } |
2175 | 2178 | ||
2176 | *idx_skip = idx; | 2179 | *idx_skip = 0; |
2177 | unlock: | 2180 | unlock: |
2178 | rcu_read_unlock(); | 2181 | rcu_read_unlock(); |
2179 | return 0; | 2182 | return ret; |
2180 | } | 2183 | } |
2181 | 2184 | ||
2182 | /** | 2185 | /** |
@@ -2391,22 +2394,25 @@ batadv_bla_backbone_dump_bucket(struct sk_buff *msg, u32 portid, u32 seq, | |||
2391 | { | 2394 | { |
2392 | struct batadv_bla_backbone_gw *backbone_gw; | 2395 | struct batadv_bla_backbone_gw *backbone_gw; |
2393 | int idx = 0; | 2396 | int idx = 0; |
2397 | int ret = 0; | ||
2394 | 2398 | ||
2395 | rcu_read_lock(); | 2399 | rcu_read_lock(); |
2396 | hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) { | 2400 | hlist_for_each_entry_rcu(backbone_gw, head, hash_entry) { |
2397 | if (idx++ < *idx_skip) | 2401 | if (idx++ < *idx_skip) |
2398 | continue; | 2402 | continue; |
2399 | if (batadv_bla_backbone_dump_entry(msg, portid, seq, | 2403 | |
2400 | primary_if, backbone_gw)) { | 2404 | ret = batadv_bla_backbone_dump_entry(msg, portid, seq, |
2405 | primary_if, backbone_gw); | ||
2406 | if (ret) { | ||
2401 | *idx_skip = idx - 1; | 2407 | *idx_skip = idx - 1; |
2402 | goto unlock; | 2408 | goto unlock; |
2403 | } | 2409 | } |
2404 | } | 2410 | } |
2405 | 2411 | ||
2406 | *idx_skip = idx; | 2412 | *idx_skip = 0; |
2407 | unlock: | 2413 | unlock: |
2408 | rcu_read_unlock(); | 2414 | rcu_read_unlock(); |
2409 | return 0; | 2415 | return ret; |
2410 | } | 2416 | } |
2411 | 2417 | ||
2412 | /** | 2418 | /** |