summaryrefslogtreecommitdiff
path: root/sys/dev/i2o/iop.c
diff options
context:
space:
mode:
authorThomas Nordin <nordin@cvs.openbsd.org>2002-06-07 09:10:14 +0000
committerThomas Nordin <nordin@cvs.openbsd.org>2002-06-07 09:10:14 +0000
commit8148a94b09e3f2e070d594d4241a3dc70a098403 (patch)
tree903ea9c1dfcd4372ba653a2b4023ab490ca13fe6 /sys/dev/i2o/iop.c
parent0b9e78847d8f49e294663df6501f22cae270d586 (diff)
Handle hashinit() failure. ok niklas@
Diffstat (limited to 'sys/dev/i2o/iop.c')
-rw-r--r--sys/dev/i2o/iop.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c
index dec24f5800a..ca99d150ec9 100644
--- a/sys/dev/i2o/iop.c
+++ b/sys/dev/i2o/iop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iop.c,v 1.21 2001/11/06 19:53:18 miod Exp $ */
+/* $OpenBSD: iop.c,v 1.22 2002/06/07 09:10:13 nordin Exp $ */
/* $NetBSD: iop.c,v 1.12 2001/03/21 14:27:05 ad Exp $ */
/*-
@@ -272,9 +272,15 @@ iop_init(struct iop_softc *sc, const char *intrstr)
int rv, i, nsegs;
int state = 0;
- if (iop_ictxhashtbl == NULL)
- iop_ictxhashtbl = hashinit(IOP_ICTXHASH_NBUCKETS,
- M_DEVBUF, M_NOWAIT, &iop_ictxhash);
+ if (iop_ictxhashtbl == NULL) {
+ iop_ictxhashtbl = hashinit(IOP_ICTXHASH_NBUCKETS, M_DEVBUF,
+ M_NOWAIT, &iop_ictxhash);
+ if (iop_ictxhashtbl == NULL) {
+ printf("%s: cannot allocate hashtable\n",
+ sc->sc_dv.dv_xname);
+ return;
+ }
+ }
/* Reset the IOP and request status. */
printf("I2O adapter");