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>
This commit is contained in:
Mateusz Guzik 2013-10-23 01:34:18 +00:00
parent 79a210c1b3
commit aa25ccfa36
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=256951

View File

@ -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;