From 2d5e325303cf9e7470b7846deba30af33046c31a Mon Sep 17 00:00:00 2001 From: Elliott Mitchell Date: Tue, 11 Oct 2022 12:25:12 -0700 Subject: [PATCH] xen/intr: always set xi_close in xen_intr_bind_isrc() Appears errors are uncommon since calling xen_intr_release_isrc() on a xenisrc with xi_close in an undefined state could be bad. Fix this problematic lurking nasty. Reviewed by: royger MFC after: 1 week --- sys/x86/xen/xen_intr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/x86/xen/xen_intr.c b/sys/x86/xen/xen_intr.c index 262df1cefeea..37b18c05b8a6 100644 --- a/sys/x86/xen/xen_intr.c +++ b/sys/x86/xen/xen_intr.c @@ -6,6 +6,7 @@ * Copyright (c) 2002-2005, K A Fraser * Copyright (c) 2005, Intel Corporation * Copyright (c) 2012, Spectra Logic Corporation + * Copyright © 2021-2023, Elliott Mitchell * * This file may be distributed separately from the Linux kernel, or * incorporated into other software packages, subject to the following license: @@ -420,6 +421,7 @@ xen_intr_bind_isrc(struct xenisrc **isrcp, evtchn_port_t local_port, } } isrc->xi_port = local_port; + isrc->xi_close = 0; xen_intr_port_to_isrc[local_port] = isrc; refcount_init(&isrc->xi_refcount, 1); mtx_unlock(&xen_intr_isrc_lock);