From 6d1e88efa36384c3d2a311cb355690d7385ae2b7 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 14 Jan 2005 21:05:35 +0000 Subject: 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. --- sys/geom/geom_disk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys') 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); } -- cgit v1.1