unconfiguring of ccd causes system panic; fix from gdonl@gv.ssi1.com; netbsd pr#1820
authorderaadt <deraadt@openbsd.org>
Fri, 8 Dec 1995 03:03:07 +0000 (03:03 +0000)
committerderaadt <deraadt@openbsd.org>
Fri, 8 Dec 1995 03:03:07 +0000 (03:03 +0000)
sys/dev/ccd.c

index 759b55b..df29bcf 100644 (file)
@@ -1107,8 +1107,9 @@ ccdioctl(dev, cmd, data, flag, p)
                        (void)vn_close(cs->sc_cinfo[i].ci_vp, FREAD|FWRITE,
                            p->p_ucred, p);
                        free(cs->sc_cinfo[i].ci_path, M_DEVBUF);
-                       free(cs->sc_itable[i].ii_index, M_DEVBUF);
                }
+               for (i = 0; cs->sc_itable[i].ii_ndisk; ++i)
+                       free(cs->sc_itable[i].ii_index, M_DEVBUF);
                free(cs->sc_cinfo, M_DEVBUF);
                free(cs->sc_itable, M_DEVBUF);
                bzero(cs, sizeof(struct ccd_softc));