From: Eric Dumazet Date: Wed, 26 Jan 2011 18:08:02 +0000 (+0000) Subject: net: fix dev_seq_next() X-Git-Tag: v2.6.39-rc1~468^2~451 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccf434380d1a67df2dcb9113206b77d0cb0a1cef;p=pandora-kernel.git net: fix dev_seq_next() Commit c6d14c84566d (net: Introduce for_each_netdev_rcu() iterator) added a race in dev_seq_next(). The rcu_dereference() call should be done _before_ testing the end of list, or we might return a wrong net_device if a concurrent thread changes net_device list under us. Note : discovered thanks to a sparse warning : net/core/dev.c:3919:9: error: incompatible types in comparison expression (different address spaces) Signed-off-by: Eric Dumazet CC: Paul E. McKenney Signed-off-by: David S. Miller --- Reading git-diff-tree failed