[PATCH] pcnet32 scrambles other modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I got a report that the pcnet32 module is mangling things upon rmmod
followed by insmod/rmmod of any other PCI driver (ksymoops mis-implicated 
rtc.o hence it was sent to me).  I think I found the problem regardless, 
but don't have the hardware to test it on. 

IIRC Jeff had a patch brewing for pcnet32 to clean things up a bit (dump
MOD_USE_COUNT and ifdef USE_PCI_REGISTER_DRIVER, fix VLbus probing which 
is currently implicitly disabled - see "return 0;" etc.) so I did not
get into that - this is only a minimal patch to (hopefully) fix the oops.

Paul.

--- drivers/net/pcnet32.c~	Sat Dec 16 04:01:43 2000
+++ drivers/net/pcnet32.c	Mon Jan 29 16:15:13 2001
@@ -161,6 +161,7 @@
  * v1.25kf Added No Interrupt on successful Tx for some Tx's <kaf@fc.hp.com>
  * v1.26   Converted to pci_alloc_consistent, Jamey Hicks / George France
  *                                           <jamey@crl.dec.com>
+ * v1.26p  Fix oops: was missing pci_unregister_driver - Paul Gortmaker.
  */
 
 
@@ -1494,6 +1495,8 @@
 static int debug = -1;
 static int tx_start_pt = -1;
 
+static int pcnet32_pci_present;
+
 static int __init pcnet32_init_module(void)
 {
     int cards_found = 0;
@@ -1510,6 +1513,8 @@
 #ifdef USE_PCI_REGISTER_DRIVER
     if ((err = pci_module_init(&pcnet32_driver)) < 0 )
        return err;
+    else
+	pcnet32_pci_present = 1;
 #else
     {
         struct pci_device_id *devid = pcnet32_pci_tbl;
@@ -1542,6 +1547,8 @@
 	kfree(pcnet32_dev);
 	pcnet32_dev = next_dev;
     }
+    if (pcnet32_pci_present)
+	pci_unregister_driver(&pcnet32_driver);
 }
 
 module_init(pcnet32_init_module);




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux