| To: | Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>, Jeff Garzik <jgarzik@xxxxxxxxx> |
|---|---|
| Subject: | [PATCH 2.5.70] Tun device encapsulation |
| From: | Stephen Hemminger <shemminger@xxxxxxxx> |
| Date: | Wed, 4 Jun 2003 15:40:22 -0700 |
| Cc: | akpm@xxxxxxxxx, davem@xxxxxxxxxx, jjs@xxxxxxxxxx, netdev@xxxxxxxxxxx |
| In-reply-to: | <20030604212528.GA24515@xxxxxxxxxxxxxxxx> |
| Organization: | Open Source Development Lab |
| References: | <20030604115236.309a173d.akpm@xxxxxxxxx> <20030604212528.GA24515@xxxxxxxxxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
Tun device was encapsulating the net_device in a private structure then doing:
unregister_netdev(&tun->dev);
kfree(tun);
rtnl_unlock();
This breaks with the delayed cleanup now in the network core.
Moving the kfree outside of the rtnl_unlock will fix it.
Builds, but not sure how to use TUN to test it.
As part of later refcounting changes, I do have a more complex change
that uses the same encapsulation as ethernet and other
devices. Will save it for later.
diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c
--- a/drivers/net/tun.c Wed Jun 4 15:38:44 2003
+++ b/drivers/net/tun.c Wed Jun 4 15:38:44 2003
@@ -551,10 +551,12 @@
if (!(tun->flags & TUN_PERSIST)) {
dev_close(&tun->dev);
unregister_netdevice(&tun->dev);
- kfree(tun);
}
rtnl_unlock();
+
+ if (!(tun->flags & TUN_PERSIST))
+ kfree(tun);
return 0;
}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 2.5.70] sb1000 driver bugs, Stephen Hemminger |
|---|---|
| Next by Date: | Re: [PATCH 2.5.70] Tun device encapsulation, jjs |
| Previous by Thread: | [PATCH 2.5.70] sb1000 driver bugs, Stephen Hemminger |
| Next by Thread: | Re: [PATCH 2.5.70] Tun device encapsulation, jjs |
| Indexes: | [Date] [Thread] [Top] [All Lists] |