summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-05-08 02:53:17 -0700
committerDavid S. Miller <davem@davemloft.net>2008-05-08 02:53:17 -0700
commite46b66bc42b6b1430b04cc5c207ecb2b2f4553dc (patch)
tree3d54cec5d517a96e7e50911c4fc74ad6346e925a /net
parentc2ab7ac225e29006b7117d6a9fe8f3be8d98b0c2 (diff)
net: Added ASSERT_RTNL() to dev_open() and dev_close().
dev_open() and dev_close() must be called holding the RTNL, since they call device functions and netdevice notifiers that are promised the RTNL. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 4addaf0df96..a1607bc0cd4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -994,6 +994,8 @@ int dev_open(struct net_device *dev)
{
int ret = 0;
+ ASSERT_RTNL();
+
/*
* Is it already up?
*/
@@ -1060,6 +1062,8 @@ int dev_open(struct net_device *dev)
*/
int dev_close(struct net_device *dev)
{
+ ASSERT_RTNL();
+
might_sleep();
if (!(dev->flags & IFF_UP))