[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-wlan-devel
Subject:    [lwlan-devel]: [patch] Bug in module unload in linux-wlan-0.3.4
From:       linux-wlan-devel () absoval ! com (Stephen C !  Tweedie)
Date:       2000-01-06 17:45:34
[Download RAW message or body]

Hi all,

There is a problem with module unloading in the linux-wlan-0.3.4.  It
bit me mainly because I was running it on a kernel with slab poisoning
enabled, which causes the kmalloc allocator to overwrite all kmalloced
data immediately when it is freed so that it is easier to find places
where the code references deleted data.

The am930 unload code was bitten by this, causing a repeatable oops
whenever the card (a standard zoomair 4000) was unloaded.  

The problem is that we call am930mac_destruct to delete the mac
structures without setting the pointer to that struct in the pcmcia
device instance to NULL.  We then call am930DI_deconfig which finds a
valid private pointer to the mac data, but by this time the kernel may
have used the memory for something else.

Normally the memory won't have been reused and so the bug does not
bite, but it should be fixed anyway.  The module unloads and reloads
perfectly with the fix below applied.

--Stephen

----------------------------------------------------------------
--- driver/am930di.c.~1~	Sat Nov  6 02:21:06 1999
+++ driver/am930di.c	Tue Jan  4 14:29:02 2000
@@ -246,6 +246,7 @@
 		if ( mac != NULL )
 		{
 			am930mac_destruct(mac);
+			instance->priv = NULL;
 		}
 
 		am930DI_deconfig(instance);
--------------------------------------------------
Linux WLAN Developer's List
For more information about this list see:
http://www.absoval.com/linux-wlan/lists.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic