Re: oops in 2.6.10-rc1-mm2 module_refcount

From: Dominik Brodowski
Date: Wed Nov 03 2004 - 10:19:26 EST


> 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

Signed-off-by: Dominik Brodowski <linux@xxxxxxxx>

--- linux/drivers/pcmcia/ds.c.original 2004-11-03 16:03:16.836857136 +0100
+++ linux/drivers/pcmcia/ds.c 2004-11-03 16:09:52.792662704 +0100
@@ -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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/