summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2001-12-13 23:52:16 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2001-12-13 23:52:16 +0000
commit05d1cd76ab0ad0e2e773ceb0ecc59b921f83315c (patch)
treeac8d1af87c25617ec6e3373de14b8e6a4f8136a7 /sys
parentf5ba45b1176a63dc3bb6e0f39ba9ae9f36a149c6 (diff)
If initialization fails, panic right away, instead of
crashing randomly a little later.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_ti.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c
index a742e12da2f..aec5e71a11e 100644
--- a/sys/dev/pci/if_ti.c
+++ b/sys/dev/pci/if_ti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ti.c,v 1.31 2001/11/06 19:53:19 miod Exp $ */
+/* $OpenBSD: if_ti.c,v 1.32 2001/12/13 23:52:15 niklas Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -2120,7 +2120,8 @@ void ti_init2(sc)
}
/* Init RX ring. */
- ti_init_rx_ring_std(sc);
+ if (ti_init_rx_ring_std(sc) == ENOBUFS)
+ panic("not enough mbufs for rx ring");
/* Init jumbo RX ring. */
if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN))