From: Ben Hutchings Date: Thu, 8 May 2008 09:53:17 +0000 (-0700) Subject: net: Added ASSERT_RTNL() to dev_open() and dev_close(). X-Git-Tag: firefly_0821_release~20319^2~22 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e46b66bc42b6b1430b04cc5c207ecb2b2f4553dc;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 4addaf0df96e..a1607bc0cd4c 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))