Thread (7 messages) 7 messages, 3 authors, 2004-06-01

Re: Bug#251215: kernel-image-2.6.6-1-k7: pppd locks up, cannot be killed, during ppp shutdown

From: David S. Miller <hidden>
Date: 2004-05-29 19:48:33

On Sat, 29 May 2004 15:17:36 +1000
Herbert Xu [off-list ref] wrote:
Why do we need to call free_netdev after unregistering the netdev
from the drivers at all? What's wrong with calling it from run_todo
itself?
Because the driver is the only agent which knows when it is safe
to free up the structure.  It may still have some attached memory
to free, for example, ala:

	unregister_netdev(dev);
	kfree(dev->priv);
	free_netdev(dev);

This is common, for example in drivers/net/tg3.c:tg3_remove_one() we
have:

		struct tg3 *tp = netdev_priv(dev);

		unregister_netdev(dev);
		iounmap((void *)tp->regs);
		free_netdev(dev);

See?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help