diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -469,7 +469,7 @@ mtx_assert(&isrc_table_lock, MA_OWNED); if (isrc->isrc_irq >= intr_nirq) - return (EINVAL); + return (0); if (irq_sources[isrc->isrc_irq] != isrc) return (EINVAL); @@ -537,7 +537,11 @@ isrc_release_counters(isrc); error = isrc_free_irq(isrc); mtx_unlock(&isrc_table_lock); - return (error); + + if (error != 0) + return (error); + + return (intr_event_destroy(isrc->isrc_event)); } #ifdef SMP