summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2005-01-14 21:05:35 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2005-01-14 21:05:35 +0000
commit032bc81d4d771364726f518ae367536d01f3c931 (patch)
tree37818634620a65bfb39a40fcc610163f646897a5
parenteec137bd0c095b04568108456302bf7f185a8e00 (diff)
Notes
-rw-r--r--sys/geom/geom_disk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 38f73d3966f4..bddb1c96386d 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);
}