summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2004-11-01 03:43:25 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2004-11-01 03:43:25 +0000
commitebbaab01d4eee56f5ee2fd2df99047801d0d516b (patch)
tree847b1758131fbffcff3434127f6f23627c58370a
parent430619e0ba623ae1dd231e6f6dc6e41a9ef81b71 (diff)
check for malloc() in bufq_default_alloc(), ok tedu@
-rw-r--r--sys/kern/subr_disk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 20e7c2c7153..c406946a460 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.27 2004/10/25 19:53:52 pedro Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.28 2004/11/01 03:43:24 pedro Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -526,6 +526,9 @@ bufq_default_alloc(void)
struct bufq_default *bq;
bq = malloc(sizeof(*bq), M_DEVBUF, M_NOWAIT);
+ if (bq == NULL)
+ panic("bufq_default_alloc: no memory");
+
memset(bq, 0, sizeof(*bq));
bq->bufq.bufq_free = bufq_default_free;
bq->bufq.bufq_add = bufq_default_add;