diff options
author | Eric Dumazet <edumazet@google.com> | 2012-08-22 17:50:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-23 12:24:42 -0400 |
commit | 748e2d9396a18c3fd3d07d47c1b41320acf1fbf4 (patch) | |
tree | 49bde8c370615258baada1d43acda2b3fb3625c2 /net/ipv4/devinet.c | |
parent | 0fa7fa98dbcc2789409ed24e885485e645803d7f (diff) |
net: reinstate rtnl in call_netdevice_notifiers()
Eric Biederman pointed out that not holding RTNL while calling
call_netdevice_notifiers() was racy.
This patch is a direct transcription his feedback
against commit 0115e8e30d6fc (net: remove delay at device dismantle)
Thanks Eric !
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Gao feng <gaofeng@cn.fujitsu.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 6a5e6e4b142c..adf273f8ad2e 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1147,12 +1147,8 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1147 | void *ptr) | 1147 | void *ptr) |
1148 | { | 1148 | { |
1149 | struct net_device *dev = ptr; | 1149 | struct net_device *dev = ptr; |
1150 | struct in_device *in_dev; | 1150 | struct in_device *in_dev = __in_dev_get_rtnl(dev); |
1151 | |||
1152 | if (event == NETDEV_UNREGISTER_FINAL) | ||
1153 | goto out; | ||
1154 | 1151 | ||
1155 | in_dev = __in_dev_get_rtnl(dev); | ||
1156 | ASSERT_RTNL(); | 1152 | ASSERT_RTNL(); |
1157 | 1153 | ||
1158 | if (!in_dev) { | 1154 | if (!in_dev) { |