diff options
-rw-r--r-- | sys/geom/geom_disk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index 38f73d3..bddb1c9 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -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); } |