Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Aug 2011 11:49:53 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r225229 - head/sys/sparc64/sbus
Message-ID:  <201108281149.p7SBnrbG050831@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sun Aug 28 11:49:53 2011
New Revision: 225229
URL: http://svn.freebsd.org/changeset/base/225229

Log:
  Since r221218 rman_manage_region(9) actually honors rm_start and rm_end
  which may cause problems when these contain garbage so zero the range
  descriptors embedding the rmans when allocating them.
  
  Approved by:	re (kib)
  MFC after:	3 days

Modified:
  head/sys/sparc64/sbus/sbus.c

Modified: head/sys/sparc64/sbus/sbus.c
==============================================================================
--- head/sys/sparc64/sbus/sbus.c	Sun Aug 28 10:10:31 2011	(r225228)
+++ head/sys/sparc64/sbus/sbus.c	Sun Aug 28 11:49:53 2011	(r225229)
@@ -303,8 +303,8 @@ sbus_attach(device_t dev)
 	    sizeof(*range), (void **)&range)) == -1) {
 		panic("%s: error getting ranges property", __func__);
 	}
-	sc->sc_rd = (struct sbus_rd *)malloc(sizeof(*sc->sc_rd) * sc->sc_nrange,
-	    M_DEVBUF, M_NOWAIT);
+	sc->sc_rd = malloc(sizeof(*sc->sc_rd) * sc->sc_nrange, M_DEVBUF,
+	    M_NOWAIT | M_ZERO);
 	if (sc->sc_rd == NULL)
 		panic("%s: cannot allocate rmans", __func__);
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108281149.p7SBnrbG050831>