* [PATCH] fix net_device leak in vlan
@ 2007-09-03 13:35 Al Viro
2007-09-03 14:23 ` Patrick McHardy
2007-09-16 23:43 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Al Viro @ 2007-09-03 13:35 UTC (permalink / raw)
To: davem; +Cc: Patrick McHardy, netdev
In "[VLAN]: Move device registation to seperate function" (commit
e89fe42cd03c8fd3686df82d8390a235717a66de), a pile of code got moved
to register_vlan_dev(), including grabbing a reference to underlying
device. However, original dev_hold() had been left behind, so we
leak a reference to net_device now...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 1583c5e..2a54691 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -562,8 +562,6 @@ static int register_vlan_device(struct net_device *real_dev,
if (err < 0)
goto out_free_newdev;
- /* Account for reference in struct vlan_dev_info */
- dev_hold(real_dev);
#ifdef VLAN_DEBUG
printk(VLAN_DBG "Allocated new device successfully, returning.\n");
#endif
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fix net_device leak in vlan
2007-09-03 13:35 [PATCH] fix net_device leak in vlan Al Viro
@ 2007-09-03 14:23 ` Patrick McHardy
2007-09-16 23:43 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2007-09-03 14:23 UTC (permalink / raw)
To: Al Viro; +Cc: davem, netdev
Al Viro wrote:
> In "[VLAN]: Move device registation to seperate function" (commit
> e89fe42cd03c8fd3686df82d8390a235717a66de), a pile of code got moved
> to register_vlan_dev(), including grabbing a reference to underlying
> device. However, original dev_hold() had been left behind, so we
> leak a reference to net_device now...
Looks good, thanks for catching this.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix net_device leak in vlan
2007-09-03 13:35 [PATCH] fix net_device leak in vlan Al Viro
2007-09-03 14:23 ` Patrick McHardy
@ 2007-09-16 23:43 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2007-09-16 23:43 UTC (permalink / raw)
To: viro; +Cc: kaber, netdev
From: Al Viro <viro@ftp.linux.org.uk>
Date: Mon, 3 Sep 2007 14:35:20 +0100
> In "[VLAN]: Move device registation to seperate function" (commit
> e89fe42cd03c8fd3686df82d8390a235717a66de), a pile of code got moved
> to register_vlan_dev(), including grabbing a reference to underlying
> device. However, original dev_hold() had been left behind, so we
> leak a reference to net_device now...
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Patch applied, thanks Al.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-09-16 23:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-03 13:35 [PATCH] fix net_device leak in vlan Al Viro
2007-09-03 14:23 ` Patrick McHardy
2007-09-16 23:43 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).