diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-04-11 15:43:25 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-04-11 15:43:25 +0000 |
commit | 156b72af2d2550c5123dbbdc56a28675a399f1e9 (patch) | |
tree | ffa843531d0ac5b40f56f94b43ca77ecd8ce63e5 | |
parent | d54c8d7ec0de7bcd7e15bf71016d6819c463d0e3 (diff) |
just fail if there are no volumes defined
-rw-r--r-- | sys/dev/ic/cac.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index ccfa25d0b94..8307731e33c 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.3 2001/02/07 04:47:26 mickey Exp $ */ +/* $OpenBSD: cac.c,v 1.4 2001/04/11 15:43:24 mickey Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -226,6 +226,11 @@ cac_init(struct cac_softc *sc, int startfw) return (-1); } + if (!cinfo.num_drvs) { + printf("%s: no volumes defined\n", sc->sc_dv.dv_xname); + return (-1); + } + sc->sc_nunits = cinfo.num_drvs; sc->sc_dinfos = malloc(cinfo.num_drvs * sizeof(struct cac_drive_info), M_DEVBUF, M_NOWAIT); |