diff options
Diffstat (limited to 'net/core/fib_rules.c')
| -rw-r--r-- | net/core/fib_rules.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 8248ebb5891d..008dc70b064b 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
| @@ -590,7 +590,8 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb, | |||
| 590 | int idx = 0; | 590 | int idx = 0; |
| 591 | struct fib_rule *rule; | 591 | struct fib_rule *rule; |
| 592 | 592 | ||
| 593 | list_for_each_entry(rule, &ops->rules_list, list) { | 593 | rcu_read_lock(); |
| 594 | list_for_each_entry_rcu(rule, &ops->rules_list, list) { | ||
| 594 | if (idx < cb->args[1]) | 595 | if (idx < cb->args[1]) |
| 595 | goto skip; | 596 | goto skip; |
| 596 | 597 | ||
| @@ -601,6 +602,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb, | |||
| 601 | skip: | 602 | skip: |
| 602 | idx++; | 603 | idx++; |
| 603 | } | 604 | } |
| 605 | rcu_read_unlock(); | ||
| 604 | cb->args[1] = idx; | 606 | cb->args[1] = idx; |
| 605 | rules_ops_put(ops); | 607 | rules_ops_put(ops); |
| 606 | 608 | ||
