diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2019-12-13 02:16:54 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2019-12-13 02:16:54 +0000 |
commit | 1fe1e9031c37071bea5181de67f15c2671810f3a (patch) | |
tree | ec3da59d533689d8fae4a5883960f6620f38837d | |
parent | 5ef3b9457b97c839edc9a7dd4578521d3de10357 (diff) |
Always release interrupt source when unmasking the interrupt
xen_intr_unmask_release was not decrementing the reference counter
on the interrupt source structure when bailing out early which led
to the refcnt overflow.
From niklas, ok mlarkin
-rw-r--r-- | sys/dev/pv/xen.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c index a2a63537378..1257b2a9a9e 100644 --- a/sys/dev/pv/xen.c +++ b/sys/dev/pv/xen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xen.c,v 1.93 2018/01/21 18:54:46 mikeb Exp $ */ +/* $OpenBSD: xen.c,v 1.94 2019/12/13 02:16:53 mikeb Exp $ */ /* * Copyright (c) 2015, 2016, 2017 Mike Belopuhov @@ -650,8 +650,10 @@ xen_intr_unmask_release(struct xen_softc *sc, struct xen_intsrc *xi) struct evtchn_unmask eu; xi->xi_masked = 0; - if (!test_bit(xi->xi_port, &sc->sc_ipg->evtchn_mask[0])) + if (!test_bit(xi->xi_port, &sc->sc_ipg->evtchn_mask[0])) { + xen_intsrc_release(sc, xi); return (0); + } eu.port = xi->xi_port; xen_intsrc_release(sc, xi); return (xen_evtchn_hypercall(sc, EVTCHNOP_unmask, &eu, sizeof(eu))); |