Re: Probable module bug in linux-2.6.5-1.358

From: Richard B. Johnson
Date: Thu Oct 07 2004 - 06:51:53 EST


On Wed, 6 Oct 2004, Stephen Hemminger wrote:

On Wed, 2004-10-06 at 18:08 -0400, Richard B. Johnson wrote:
The attached script shows that an attempt to open a device
after its module was removed, will seg-fault the kernel.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.5-1.358-noreg on an i686 machine (5537.79 BogoMips).
Note 96.31% of all statistics are fiction.



Oct 6 17:03:30 chaos kernel: Analogic Corp Datalink Driver : Module
removed

The bug is in that driver. It needs to unregister the character device
in it's module remove routine. It doesn't appear to be in the main
kernel source tree so bug Redhat or the vendor.



It certainly does unregister the device.........

if((ret = unregister_chrdev(MAJOR_NR, devname)) < 0)
{
printk(KERN_ALERT"%s : Can't unregister major number %d (%d)\n",
devname, MAJOR_NR, ret);
return;
}
free_resources();
printk(KERN_INFO"%s : Module removed\n", devname);
}

.... and this works fine in 2.4.x




Cheers,
Dick Johnson
Penguin : Linux version 2.6.5-1.358-noreg on an i686 machine (5537.79 BogoMips).
Note 96.31% of all statistics are fiction.

-
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/