File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -494,24 +494,23 @@ isrc_event_create(struct intr_irqsrc *isrc)
494494 return (error );
495495}
496496
497- #ifdef notyet
498497/*
499498 * Destroy interrupt event for interrupt source.
500499 */
501- static void
500+ static int
502501isrc_event_destroy (struct intr_irqsrc * isrc )
503502{
504- struct intr_event * ie ;
503+ int rc ;
505504
506- mtx_lock (& isrc_table_lock );
507- ie = isrc -> isrc_event ;
508- isrc -> isrc_event = NULL ;
509- mtx_unlock (& isrc_table_lock );
505+ MPASS (isrc -> isrc_event != NULL );
506+ MPASS (isrc -> isrc_event -> ie_irq >= intr_nirq );
507+
508+ rc = intr_event_destroy (isrc -> isrc_event );
509+ if (rc == 0 )
510+ isrc -> isrc_event = NULL ;
510511
511- if (ie != NULL )
512- intr_event_destroy (ie );
512+ return (rc );
513513}
514- #endif
515514
516515/*
517516 * Alloc unique interrupt number (resource handle) for interrupt source.
@@ -643,7 +642,11 @@ intr_isrc_deregister(struct intr_irqsrc *isrc)
643642 isrc_release_counters (isrc );
644643 error = isrc_free_irq (isrc );
645644 mtx_unlock (& isrc_table_lock );
646- return (error );
645+
646+ if (error != 0 )
647+ return (error );
648+
649+ return (isrc_event_destroy (isrc ));
647650}
648651
649652#ifdef SMP
You can’t perform that action at this time.
0 commit comments