From 92b5e86ebfaf8754806df71f34bc0fa9956fa014 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 22 Aug 2003 10:22:46 +0000 Subject: Check for null softc pointers, these happens when a ccd is withering. Found by: David Schultz --- sys/geom/geom_ccd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/geom/geom_ccd.c') diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index ff951d55800d..c2f309ab0757 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -688,7 +688,7 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp) /* Check for duplicate unit */ LIST_FOREACH(gp, &mp->geom, geom) { sc = gp->softc; - if (sc->sc_unit == *unit) { + if (sc != NULL && sc->sc_unit == *unit) { gctl_error(req, "Unit %d already configured", *unit); return; } @@ -817,7 +817,7 @@ g_ccd_list(struct gctl_req *req, struct g_class *mp) sbuf_clear(sb); LIST_FOREACH(gp, &mp->geom, geom) { cs = gp->softc; - if (unit >= 0 && unit != cs->sc_unit) + if (cs == NULL || (unit >= 0 && unit != cs->sc_unit)) continue; sbuf_printf(sb, "ccd%d\t\t%d\t%d\t", cs->sc_unit, cs->sc_ileave, cs->sc_flags & CCDF_USERMASK); -- cgit v1.2.3