Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2013 01:34:19 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256951 - head/sys/geom/nop
Message-ID:  <201310230134.r9N1YJgb044372@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Wed Oct 23 01:34:18 2013
New Revision: 256951
URL: http://svnweb.freebsd.org/changeset/base/256951

Log:
  gnop: make sure that newly allocated memory for softc is zeroed
  
  This prevents mtx_init from encountering non-zeros and panicking
  the kernel as a result.
  
  Reported by:	Keith White <kwhite site.uottawa.ca>

Modified:
  head/sys/geom/nop/g_nop.c

Modified: head/sys/geom/nop/g_nop.c
==============================================================================
--- head/sys/geom/nop/g_nop.c	Wed Oct 23 00:43:22 2013	(r256950)
+++ head/sys/geom/nop/g_nop.c	Wed Oct 23 01:34:18 2013	(r256951)
@@ -216,7 +216,7 @@ g_nop_create(struct gctl_req *req, struc
 		}
 	}
 	gp = g_new_geomf(mp, "%s", name);
-	sc = g_malloc(sizeof(*sc), M_WAITOK);
+	sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
 	sc->sc_offset = offset;
 	sc->sc_explicitsize = explicitsize;
 	sc->sc_error = ioerror;



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