From d67373efece6c4c01148cfcd1b36184b256cf4b5 Mon Sep 17 00:00:00 2001 From: Niall O'Higgins Date: Thu, 12 May 2005 14:16:39 +0000 Subject: 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@ --- sys/dev/ccd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/dev') 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 -- cgit v1.2.3