In message: <[EMAIL PROTECTED]> Nate Lawson <[EMAIL PROTECTED]> writes: : * Add bus_child_present check to calls to *_stop in the detach method for : devices that have children (i.e. miibus).
bus_child_present isn't quite right for this. bus_child_present means "this child is still there in hardware" not "this node has children" + if (device_is_alive(dev)) { + if (bus_child_present(dev)) { + dc_stop(sc); + device_delete_child(dev, sc->dc_miibus); + } + ether_ifdetach(ifp); + bus_generic_detach(dev); + } should be just: + if (device_is_alive(dev)) { + if (bus_child_present(dev)) + dc_stop(sc); + device_delete_child(dev, sc->dc_miibus); + ether_ifdetach(ifp); + bus_generic_detach(dev); + } since it says 'if the card is still there, stop it' which is what you want in the cardbus case (and one day hotplug pci) since the card might not be there, in which case trying to do anything with it is doomed to failure. Please fix this issue before commit. # guess this is my fault for never writing a bus_child_present man # page :-( Also, on a stylistic note: - free(sc->dc_srom, M_DEVBUF); + if (sc->dc_srom) + free(sc->dc_srom, M_DEVBUF); The kernel free, just like its ANSI-89 userland counterpart, can tolerate free(NULL) now. I know some of the other frees check, some don't, but none should. I'd not hold up the commit on this issue, however. from kern_malloc.c: void free(addr, type) void *addr; struct malloc_type *type; { ... /* free(NULL, ...) does nothing */ if (addr == NULL) return; ... Warner _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "[EMAIL PROTECTED]"