Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-block.git] / net / core / fib_rules.c
index 8248ebb5891d0764eebb9d4cbc2256c091ff357c..008dc70b064b3043cbf17fd4a63605db51d0fa94 100644 (file)
@@ -590,7 +590,8 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb,
        int idx = 0;
        struct fib_rule *rule;
 
-       list_for_each_entry(rule, &ops->rules_list, list) {
+       rcu_read_lock();
+       list_for_each_entry_rcu(rule, &ops->rules_list, list) {
                if (idx < cb->args[1])
                        goto skip;
 
@@ -601,6 +602,7 @@ static int dump_rules(struct sk_buff *skb, struct netlink_callback *cb,
 skip:
                idx++;
        }
+       rcu_read_unlock();
        cb->args[1] = idx;
        rules_ops_put(ops);