Skip to content

Commit

Permalink
net: Added ASSERT_RTNL() to dev_open() and dev_close().
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed May 8, 2008
1 parent c2ab7ac commit e46b66b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,8 @@ int dev_open(struct net_device *dev)
{
int ret = 0;

ASSERT_RTNL();

/*
* Is it already up?
*/
Expand Down Expand 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))
Expand Down

0 comments on commit e46b66b

Please sign in to comment.