CAM will sometimes remove a disk again even before it finished being

initialized.  We already cancel the pending events but we need to not
dereference the geom pointer which never got set different from NULL.
This commit is contained in:
Poul-Henning Kamp 2005-01-14 21:05:35 +00:00
parent eec137bd0c
commit 032bc81d4d

View File

@ -365,8 +365,10 @@ g_disk_destroy(void *ptr, int flag)
g_topology_assert();
dp = ptr;
gp = dp->d_geom;
gp->softc = NULL;
g_wither_geom(gp, ENXIO);
if (gp != NULL) {
gp->softc = NULL;
g_wither_geom(gp, ENXIO);
}
g_free(dp);
}