summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-08-22 10:22:46 +0000
committerphk <phk@FreeBSD.org>2003-08-22 10:22:46 +0000
commitd2368e58de1fa7b28a311922714f7a8d39abcac9 (patch)
treec8f8aca3753518a9df405adf1da301720ea17c60 /sys/geom
parent53f32078e5349fbc8bea217da3b8e26d27a7b213 (diff)
downloadFreeBSD-src-d2368e58de1fa7b28a311922714f7a8d39abcac9.zip
FreeBSD-src-d2368e58de1fa7b28a311922714f7a8d39abcac9.tar.gz
Check for null softc pointers, these happens when a ccd is withering.
Found by: David Schultz <dschultz@OCF.Berkeley.EDU>
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_ccd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c
index ff951d5..c2f309a 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);
OpenPOWER on IntegriCloud