OSDN Git Service

backport vlan device unregister fix
authorMarcel Sebek <sebek64@post.cz>
Thu, 23 Oct 2008 14:09:34 +0000 (16:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 9 Nov 2008 14:06:09 +0000 (15:06 +0100)
Hi.

The attached patch was merged into 2.6.8 kernel, see

http://www.linux.sgi.com/archives/netdev/2004-08/msg00076.html

However, no similar fix is in 2.4. I've faced the problem on a
2.4.26 kernel (with external patches) and with DEBUG_SLAB turned on.
When I unregister network device with attached vlan device, the vlan
device structure is freed too early (because of wrong refcounting) and
dev_mc_discard call in unregister_netdevice uses this freed memmory,
which causes oops.

Signed-off-by: Marcel Å ebek <sebek64@post.cz>
net/8021q/vlan.c

index 3c67e20..88f144a 100644 (file)
@@ -635,7 +635,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
                        ret = unregister_vlan_dev(dev,
                                                  VLAN_DEV_INFO(vlandev)->vlan_id);
 
-                       dev_put(vlandev);
                        unregister_netdevice(vlandev);
 
                        /* Group was destroyed? */