]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
net: Added ASSERT_RTNL() to dev_open() and dev_close().
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 8 May 2008 09:53:17 +0000 (02:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 May 2008 09:53:17 +0000 (02:53 -0700)
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>
net/core/dev.c

index 4addaf0df96e3f81e4973f436ba92c9b0c71d9f7..a1607bc0cd4cd3601b2183616845b564a1057c52 100644 (file)
@@ -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))