From 8148a94b09e3f2e070d594d4241a3dc70a098403 Mon Sep 17 00:00:00 2001 From: Thomas Nordin Date: Fri, 7 Jun 2002 09:10:14 +0000 Subject: Handle hashinit() failure. ok niklas@ --- sys/dev/i2o/iop.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sys/dev') 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"); -- cgit v1.2.3