Date: Sat, 23 Nov 2013 23:54:38 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258505 - stable/10/sys/geom/nop Message-ID: <201311232354.rANNscU0020926@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sat Nov 23 23:54:38 2013 New Revision: 258505 URL: http://svnweb.freebsd.org/changeset/base/258505 Log: MFC r256951: 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. Approved by: re Modified: stable/10/sys/geom/nop/g_nop.c Directory Properties: stable/10/sys/ (props changed) Modified: stable/10/sys/geom/nop/g_nop.c ============================================================================== --- stable/10/sys/geom/nop/g_nop.c Sat Nov 23 18:58:17 2013 (r258504) +++ stable/10/sys/geom/nop/g_nop.c Sat Nov 23 23:54:38 2013 (r258505) @@ -214,7 +214,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?201311232354.rANNscU0020926>