Skip to contentSkip to conversation

oops in 2.6.10-rc1-mm2 module_refcount

DISCUSSION Dominik Brodowski 1 participant 1 message Nov 3, 2004 1 message not in the archive Pcmcia

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 11 lines
Unable to handle kernel NULL pointer dereference at virtual address 000000a0
printing eip:
c0146807
*pde = 00000000
Oops: 0000 [#1]
PREEMPT 
Modules linked in:
CPU:    0
EIP:    0060:[<c0146807>]    Not tainted VLI
EFLAGS: 00010282   (2.6.10-rc1-mm2-pleiades) 

EIP is at module_refcount+0x7/0x10

module_refcount() on non-modules fails [in contrary to try_module_get()], causing this bug when accessing /proc/bus/pccard/drivers and a pcmcia driver is built into the kernel.

Applies on top of
- pcmcia-17-device-model-integration.patch
- pcmcia-18a-client_t-and-pcmcia_device-integration.patch
- pcmcia-18b-error-on-leftover-devices.patch
- pcmcia-19-netdevice-integration.patch

drivers/pcmcia/ds.c renamed from drivers/pcmcia/ds.c.original +1 -1
@@ -313,7 +313,7 @@
 
 	*p += sprintf(*p, "%-24.24s 1 %d\n", p_drv->drv.name, 
 #ifdef CONFIG_MODULE_UNLOAD
-		      module_refcount(p_drv->owner)
+		     (p_drv->owner) ? module_refcount(p_drv->owner) : 1
 #else
 		      1
 #endif