linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] DEPCA Network card module unload Oops
@ 2001-08-10 16:18 Peter Denison
  0 siblings, 0 replies; only message in thread
From: Peter Denison @ 2001-08-10 16:18 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Alan Cox, linux-kernel

Description:
	The DEPCA/DE100 etc network card driver oopses on unload if
compiled as a module and if CONFIG_NETLINK & CONFIG_RTNETLINK are
defined. This patch fixes the problem.

Detail:
	On network adapter unload, unregister_netdev() calls down the
notifier chain, announcing the unload. If RTNETLINK is compiled in, then
one of the notifications is rtnetlink_event(), eventually calling
rtnetlink_fill_ifinfo(), which does a dev->get_stats(dev). If the stats
call to the driver uses private info, then the call to unregister_netdev()
must happen before the private data is freed. I haven't checked any other
network drivers for this, but it may be worth doing.

Patch:

--- drivers/net/depca.c.old	Sun Jul 15 16:43:58 2001
+++ drivers/net/depca.c	Wed Aug  8 21:06:45 2001
@@ -2060,6 +2060,8 @@
 cleanup_module(void)
 {
   struct depca_private *lp = thisDepca.priv;
+
+  unregister_netdev(&thisDepca);
   if (lp) {
     iounmap(lp->sh_mem);
 #ifdef CONFIG_MCA
@@ -2071,7 +2073,6 @@
   }
   thisDepca.irq=0;

-  unregister_netdev(&thisDepca);
   release_region(thisDepca.base_addr, DEPCA_TOTAL_SIZE);
 }
 #endif /* MODULE */

-- 
Peter Denison <peterd@pnd-pc.demon.co.uk>
Linux Driver for Promise DC4030VL cards.
See http://www.pnd-pc.demon.co.uk/promise/promise.html for details


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-10 16:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-10 16:18 [PATCH] DEPCA Network card module unload Oops Peter Denison

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).