]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/route.c
[IPV4] ROUTE: fix rcu_dereference() uses in /proc/net/rt_cache
[linux-2.6-omap-h63xx.git] / net / ipv4 / route.c
index d3377069ce05bcdcf2a2a69a1963b6fc7f25b03c..28484f396b048e1dd49210e5caffc24e29148f2b 100644 (file)
@@ -283,12 +283,12 @@ static struct rtable *rt_cache_get_first(struct seq_file *seq)
                        break;
                rcu_read_unlock_bh();
        }
-       return r;
+       return rcu_dereference(r);
 }
 
 static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r)
 {
-       struct rt_cache_iter_state *st = rcu_dereference(seq->private);
+       struct rt_cache_iter_state *st = seq->private;
 
        r = r->u.dst.rt_next;
        while (!r) {
@@ -298,7 +298,7 @@ static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r)
                rcu_read_lock_bh();
                r = rt_hash_table[st->bucket].chain;
        }
-       return r;
+       return rcu_dereference(r);
 }
 
 static struct rtable *rt_cache_get_idx(struct seq_file *seq, loff_t pos)