--- sys/dev/ata/atapi-cd.c Tue Apr 18 14:07:03 2006 +++ sys/dev/ata/atapi-cd.c.patched Tue Apr 18 14:06:49 2006 @@ -192,9 +192,13 @@ acd_geom_detach(void *arg, int flag) { struct acd_softc *cdp = device_get_ivars(arg); - - /* signal geom so we dont get any further requests */ - g_wither_geom(cdp->gp, ENXIO); + + if (cdp != NULL) { + /* signal geom so we dont get any further requests */ + g_wither_geom(cdp->gp, ENXIO); + } else { + device_printf(arg, "already detached\n"); + } /* fail requests on the queue and any thats "in flight" for this device */ ata_fail_requests(arg);