diff options
author | Marius Strobl <marius@FreeBSD.org> | 2005-04-16 15:02:16 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2005-04-16 15:02:16 +0000 |
commit | 197bb5864f1737b32f9a863a828ef472e5272ceb (patch) | |
tree | aa0539e56e64388306d3d94b3609615fc4e855ef /sys/sparc64 | |
parent | 50f046e614867ba89b1525e3ab514dbfc9e02b52 (diff) | |
download | src-197bb5864f1737b32f9a863a828ef472e5272ceb.tar.gz src-197bb5864f1737b32f9a863a828ef472e5272ceb.zip |
Some changes to intr_execute_handlers():
- Fix NULL pointer dereferences caused when an ithread or a handler is
NULL which happens when a stray interrupt triggers after the respective
device interrupt was torn down.
- Remove the critical section around INTR_FAST handlers which actually
was a nested critical section. Both tl0_intr() and tl1_intr() already
enter a critical section for calling intr_execute_handlers().
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=145152
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/intr_machdep.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/sparc64/sparc64/intr_machdep.c b/sys/sparc64/sparc64/intr_machdep.c index ec1f9c02ee2d..f460f20989cd 100644 --- a/sys/sparc64/sparc64/intr_machdep.c +++ b/sys/sparc64/sparc64/intr_machdep.c @@ -240,12 +240,13 @@ intr_execute_handlers(void *cookie) iv = cookie; ithd = iv->iv_ithd; - MPASS(ithd != NULL); - ih = TAILQ_FIRST(&ithd->it_handlers); - if (ih->ih_flags & IH_FAST) { + if (ithd == NULL) + ih = NULL; + else + ih = TAILQ_FIRST(&ithd->it_handlers); + if (ih != NULL && ih->ih_flags & IH_FAST) { /* Execute fast interrupt handlers directly. */ - critical_enter(); TAILQ_FOREACH(ih, &ithd->it_handlers, ih_next) { MPASS(ih->ih_flags & IH_FAST && ih->ih_argument != NULL); @@ -253,12 +254,11 @@ intr_execute_handlers(void *cookie) __func__, ih->ih_handler, ih->ih_argument); ih->ih_handler(ih->ih_argument); } - critical_exit(); return; } /* Schedule a heavyweight interrupt process. */ - error = ithread_schedule(iv->iv_ithd); + error = ithread_schedule(ithd); if (error == EINVAL) intr_stray_vector(iv); } |