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:
phk 2005-01-14 21:05:35 +00:00
parent 7c55d0e338
commit 6d1e88efa3

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);
}