From aa25ccfa362e05ffdae6deda718da8fd5bd69cb2 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Wed, 23 Oct 2013 01:34:18 +0000 Subject: [PATCH] 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 --- sys/geom/nop/g_nop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/nop/g_nop.c b/sys/geom/nop/g_nop.c index e6b44bb1d21..bd72d780a4b 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;