From: jasper Date: Wed, 23 Jul 2014 10:06:18 +0000 (+0000) Subject: correctly drain and destroy the bufq upon detach X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f88331f57017f2b97386e2a6071165acd19d25fe;p=openbsd correctly drain and destroy the bufq upon detach ok dlg@ --- diff --git a/sys/arch/octeon/dev/octcf.c b/sys/arch/octeon/dev/octcf.c index 3150065face..cc842e28aae 100644 --- a/sys/arch/octeon/dev/octcf.c +++ b/sys/arch/octeon/dev/octcf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octcf.c,v 1.23 2014/07/22 17:26:03 jasper Exp $ */ +/* $OpenBSD: octcf.c,v 1.24 2014/07/23 10:06:18 jasper Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -274,9 +274,12 @@ octcfdetach(struct device *self, int flags) { struct octcf_softc *sc = (struct octcf_softc *)self; + bufq_drain(&sc->sc_bufq); + disk_gone(octcfopen, self->dv_unit); /* Detach disk. */ + bufq_destroy(&sc->sc_bufq); disk_detach(&sc->sc_dk); return (0);