It turns out that it's OK to sleep in this context, so use M_WAITOK

for the softc for the delay module.

Noticed by: rpokala@
This commit is contained in:
Warner Losh
2015-12-18 14:10:00 +00:00
parent 4ba79bb433
commit 268f69f40b
+1 -2
View File
@@ -201,8 +201,7 @@ g_delay_init(struct g_geom *geom)
{
struct g_delay_softc *sc;
/* XXX check whether we can sleep */
sc = malloc(sizeof *sc, M_GEOM_SCHED, M_NOWAIT | M_ZERO);
sc = malloc(sizeof *sc, M_GEOM_SCHED, M_WAITOK | M_ZERO);
sc->sc_geom = geom;
bioq_init(&sc->sc_bioq);
callout_init(&sc->sc_wait, CALLOUT_MPSAFE);