summaryrefslogtreecommitdiff
path: root/sys/dev/vscsi.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-01-02 10:38:23 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-01-02 10:38:23 +0000
commitc160d673786593d3d0c0b4c8ec660c5313f9b4dd (patch)
treef62c89ae8fde073482b7b0d6b1453685a20ef16c /sys/dev/vscsi.c
parent8f0bc7da5b54937984cfde5d1ca10a8f27041c00 (diff)
give the device ref taken in vscsikqfilter to the knote, and unref
it in filt_vscsidetach.
Diffstat (limited to 'sys/dev/vscsi.c')
-rw-r--r--sys/dev/vscsi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c
index c9938dea03c..64c8fc05a32 100644
--- a/sys/dev/vscsi.c
+++ b/sys/dev/vscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vscsi.c,v 1.35 2015/01/02 10:32:21 dlg Exp $ */
+/* $OpenBSD: vscsi.c,v 1.36 2015/01/02 10:38:22 dlg Exp $ */
/*
* Copyright (c) 2008 David Gwynne <dlg@openbsd.org>
@@ -585,7 +585,8 @@ vscsikqfilter(dev_t dev, struct knote *kn)
SLIST_INSERT_HEAD(klist, kn, kn_selnext);
mtx_leave(&sc->sc_sel_mtx);
- device_unref(&sc->sc_dev);
+ /* device ref is given to the knote in the klist */
+
return (0);
}
@@ -598,6 +599,8 @@ filt_vscsidetach(struct knote *kn)
mtx_enter(&sc->sc_sel_mtx);
SLIST_REMOVE(klist, kn, knote, kn_selnext);
mtx_leave(&sc->sc_sel_mtx);
+
+ device_unref(&sc->sc_dev);
}
int