diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-16 05:02:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-16 05:02:18 -0400 |
commit | f3005d7f4abe03ad41af33b1548602cd086d86a2 (patch) | |
tree | 937c5b6ba6089f93fa4f0a11a37ab07a8564e398 /net/core | |
parent | 3661a910836a509be65afc3c1e512d900e1280f9 (diff) |
[NETNS]: Add netns refcnt debug for network devices.
dev_set_net is called for
- just allocated devices
- devices moving from one namespace to another
release_net has proper check inside to distinguish these cases.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 7aa01125287e..77530e9a34fc 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4042,6 +4042,8 @@ EXPORT_SYMBOL(alloc_netdev_mq); | |||
4042 | */ | 4042 | */ |
4043 | void free_netdev(struct net_device *dev) | 4043 | void free_netdev(struct net_device *dev) |
4044 | { | 4044 | { |
4045 | release_net(dev_net(dev)); | ||
4046 | |||
4045 | /* Compatibility with error handling in drivers */ | 4047 | /* Compatibility with error handling in drivers */ |
4046 | if (dev->reg_state == NETREG_UNINITIALIZED) { | 4048 | if (dev->reg_state == NETREG_UNINITIALIZED) { |
4047 | kfree((char *)dev - dev->padded); | 4049 | kfree((char *)dev - dev->padded); |