diff options
author | markj <markj@FreeBSD.org> | 2017-12-08 20:04:10 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2017-12-08 20:04:10 +0000 |
commit | eaca327723c771c7e5cfc6c89ac0490452093aca (patch) | |
tree | a4b2d40e6b05fb8b404de587315c60b652bc74d2 /sys/geom | |
parent | c6de65d57fd7f6c37c8f0fd3880f79f6ec9cbdd5 (diff) | |
download | FreeBSD-src-eaca327723c771c7e5cfc6c89ac0490452093aca.zip FreeBSD-src-eaca327723c771c7e5cfc6c89ac0490452093aca.tar.gz |
MFC r325044:
Fix a lock leak in g_mirror_destroy().
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 39a22be..4a5f542 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -3088,8 +3088,10 @@ g_mirror_destroy(struct g_mirror_softc *sc, int how) } } - if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + sx_xunlock(&sc->sc_lock); return (0); + } sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY; sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DRAIN; G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); |