diff --git a/sys/dev/xen/bus/xen_intr.c b/sys/dev/xen/bus/xen_intr.c --- a/sys/dev/xen/bus/xen_intr.c +++ b/sys/dev/xen/bus/xen_intr.c @@ -814,16 +814,8 @@ } isrc->xi_port = alloc_unbound.port; - error = xen_intr_bind_isrc(isrc, name, port_handlep); - if (error != 0) { - evtchn_close_t close = { .port = alloc_unbound.port }; - if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close)) - panic("EVTCHNOP_close failed"); - return (error); - } - - isrc->xi_close = 1; - return (0); + isrc->xi_close = true; + return (xen_intr_bind_isrc(isrc, name, port_handlep)); } int @@ -857,20 +849,12 @@ } isrc->xi_port = bind_interdomain.local_port; - error = xen_intr_bind_isrc(isrc, name, port_handlep); - if (error) { - evtchn_close_t close = { .port = bind_interdomain.local_port }; - if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close)) - panic("EVTCHNOP_close failed"); - return (error); - } - /* * The Event Channel API opened this port, so it is * responsible for closing it automatically on unbind. */ - isrc->xi_close = 1; - return (0); + isrc->xi_close = true; + return (xen_intr_bind_isrc(isrc, name, port_handlep)); } int @@ -904,23 +888,12 @@ } isrc->xi_port = bind_virq.port; - error = xen_intr_bind_isrc(isrc, name, port_handlep); - - if (error != 0) { - evtchn_close_t close = { .port = bind_virq.port }; - - if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close)) - panic("EVTCHNOP_close failed"); - return (error); - } - /* * The Event Channel API opened this port, so it is * responsible for closing it automatically on unbind. */ - isrc->xi_close = 1; - - return (0); + isrc->xi_close = true; + return (xen_intr_bind_isrc(isrc, name, port_handlep)); } int @@ -956,21 +929,12 @@ } isrc->xi_port = bind_ipi.port; - error = xen_intr_bind_isrc(isrc, name, port_handlep); - if (error != 0) { - evtchn_close_t close = { .port = bind_ipi.port }; - - if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close)) - panic("EVTCHNOP_close failed"); - return (error); - } - /* * The Event Channel API opened this port, so it is * responsible for closing it automatically on unbind. */ - isrc->xi_close = 1; - return (0); + isrc->xi_close = true; + return (xen_intr_bind_isrc(isrc, name, port_handlep)); #else return (EOPNOTSUPP); #endif