diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-05-09 23:55:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-10 18:03:01 -0400 |
commit | 1fc19aff84edf97753c58cf4b858c6c4fdb246fa (patch) | |
tree | 15d4eb3545a1edf20103bb1ef927d7e7ba7b6c2e /net/ipv4/devinet.c | |
parent | 8f01cb0827c84bd9c4866b849415b3aa6f0428df (diff) |
net: fix two lockdep splats
Commit e67f88dd12f6 (net: dont hold rtnl mutex during netlink dump
callbacks) switched rtnl protection to RCU, but we forgot to adjust two
rcu_dereference() lockdep annotations :
inet_get_link_af_size() or inet_fill_link_af() might be called with
rcu_read_lock or rtnl held, so use rcu_dereference_rtnl()
instead of rtnl_dereference()
Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index cd9ca0811cfa..0d4a184af16f 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1369,7 +1369,7 @@ errout: | |||
1369 | 1369 | ||
1370 | static size_t inet_get_link_af_size(const struct net_device *dev) | 1370 | static size_t inet_get_link_af_size(const struct net_device *dev) |
1371 | { | 1371 | { |
1372 | struct in_device *in_dev = __in_dev_get_rtnl(dev); | 1372 | struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr); |
1373 | 1373 | ||
1374 | if (!in_dev) | 1374 | if (!in_dev) |
1375 | return 0; | 1375 | return 0; |
@@ -1379,7 +1379,7 @@ static size_t inet_get_link_af_size(const struct net_device *dev) | |||
1379 | 1379 | ||
1380 | static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev) | 1380 | static int inet_fill_link_af(struct sk_buff *skb, const struct net_device *dev) |
1381 | { | 1381 | { |
1382 | struct in_device *in_dev = __in_dev_get_rtnl(dev); | 1382 | struct in_device *in_dev = rcu_dereference_rtnl(dev->ip_ptr); |
1383 | struct nlattr *nla; | 1383 | struct nlattr *nla; |
1384 | int i; | 1384 | int i; |
1385 | 1385 | ||