Messages in this thread | | | From | kuznet@ms2 ... | Subject | Re: smc-ultra/netlink oops in 2.2.3 .. 2.2.8 | Date | Fri, 14 May 1999 22:57:01 +0400 (MSK DST) |
| |
Hello!
> I get an oops whenever I remove the smc-ultra module ... > This problem occurs in kernels 2.2.3 > .. 2.2.8 and not in 2.2.2 and before.
It is interesting. Are you sure? This bug was known since ~2.1.70 or so. The fast fast fix is to add to get_stats() in 8390.c:
struct ei_device *ei_local = (struct ei_device *) dev->priv; unsigned long flags; + + if (ei_local == NULL) + return NULL; /* If the card is stopped, just return the present stats. */ if (dev->start == 0) return &ei_local->stat;
The fix is incomplete, actual fix requires changing invalid cleanup_module() inside drivers. F.e. in the case of smc-utra it is:
if (dev->priv != NULL) { /* NB: ultra_close_card() does free_irq + irq2dev */ int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; - kfree(dev->priv); - dev->priv = NULL; - release_region(ioaddr, ULTRA_IO_EXTENT); - unregister_netdev(dev); + /* The first thing to make in destroying any device + is to unregister it. Before the device is unregistered, + the kernel is allowed and WILL access it. It even + may open it. + */ + unregister_netdev(dev); + kfree(dev->priv); + release_region(ioaddr, ULTRA_IO_EXTENT); }
Again, only author of the driver (or anyone knowing enough about it) can predict, is it OK or not to leave dev->priv!=NULL during unregister. If it is not OK, the driver is broken.
Alexey
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |