diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2013-10-23 01:34:18 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2013-10-23 01:34:18 +0000 |
commit | aa25ccfa362e05ffdae6deda718da8fd5bd69cb2 (patch) | |
tree | 03c46e13521d55d8fff884357dec892275b6e028 /sys/geom | |
parent | 79a210c1b363040507fec907c679a2efe39f135c (diff) | |
download | src-aa25ccfa362e05ffdae6deda718da8fd5bd69cb2.tar.gz src-aa25ccfa362e05ffdae6deda718da8fd5bd69cb2.zip |
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>
Notes
Notes:
svn path=/head/; revision=256951
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/nop/g_nop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c index e6b44bb1d218..bd72d780a4b8 100644 --- a/sys/geom/nop/g_nop.c +++ b/sys/geom/nop/g_nop.c @@ -216,7 +216,7 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, } } 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; |