summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-01-14 21:05:35 +0000
committerphk <phk@FreeBSD.org>2005-01-14 21:05:35 +0000
commit6d1e88efa36384c3d2a311cb355690d7385ae2b7 (patch)
tree37818634620a65bfb39a40fcc610163f646897a5 /sys/geom/geom_disk.c
parent7c55d0e3383145745cc9a35fa152e6d6bcb6d416 (diff)
downloadFreeBSD-src-6d1e88efa36384c3d2a311cb355690d7385ae2b7.zip
FreeBSD-src-6d1e88efa36384c3d2a311cb355690d7385ae2b7.tar.gz
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.
Diffstat (limited to 'sys/geom/geom_disk.c')
-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 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);
}
OpenPOWER on IntegriCloud