summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorNiall O'Higgins <niallo@cvs.openbsd.org>2005-05-12 14:16:39 +0000
committerNiall O'Higgins <niallo@cvs.openbsd.org>2005-05-12 14:16:39 +0000
commitd67373efece6c4c01148cfcd1b36184b256cf4b5 (patch)
treeb534ce8b286ef932cb53968313b7bdeb4fd0a8be /sys/dev
parent23f6e4570842bb6477edcb21df672e7e12e1d95f (diff)
Add a bzero() after malloc() when allocating component info in ccdinit().
This fixes a panic in ccd(4) mirroring where the second component could be wrongly treated as failed, which leads to uvm_fault in write operation. ok mickey@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ccd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index ef15ea0894f..5977b56e053 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.59 2005/03/30 22:28:00 mickey Exp $ */
+/* $OpenBSD: ccd.c,v 1.60 2005/05/12 14:16:38 niallo Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -309,6 +309,7 @@ ccdinit(ccd, cpaths, p)
/* Allocate space for the component info. */
cs->sc_cinfo = malloc(cs->sc_nccdisks * sizeof(struct ccdcinfo),
M_DEVBUF, M_WAITOK);
+ bzero(cs->sc_cinfo, cs->sc_nccdisks * sizeof(struct ccdcinfo));
/*
* Verify that each component piece exists and record