diff options
author | se <se@FreeBSD.org> | 1997-05-28 22:11:00 +0000 |
---|---|---|
committer | se <se@FreeBSD.org> | 1997-05-28 22:11:00 +0000 |
commit | cb12eb9f1da3c4f679d96f98608d78b490066b0a (patch) | |
tree | 97e4a9c143cc3256edfb283b1008e6e028e10049 /sys/kern/kern_intr.c | |
parent | da224a236351fb025ae0ce9c73cd06a094cd3d9f (diff) | |
download | FreeBSD-src-cb12eb9f1da3c4f679d96f98608d78b490066b0a.zip FreeBSD-src-cb12eb9f1da3c4f679d96f98608d78b490066b0a.tar.gz |
Fix problem reported by PHK: Panic in pcic probe because of NULL pointer
dereference (head->next in intr_disconnect).
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r-- | sys/kern/kern_intr.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index fa17cf1..be5c29a 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id$ + * $Id: kern_intr.c,v 1.1 1997/05/26 14:37:43 se Exp $ * */ @@ -295,17 +295,20 @@ intr_disconnect(intrec *idesc) /* check whether the new list head is the only element on list */ head = intreclist_head[irq]; - if (head->next != NULL) { - /* install the multiplex handler with new list head as argument */ - errcode = icu_setup(irq, intr_mux, head, 0, 0); - if (errcode == 0) - update_intrname(irq, -1); - } else if (head != NULL) { - /* install the one remaining handler for this irq */ - errcode = icu_setup(irq, head->handler, head->argument, - head->maskptr, head->flags); - if (errcode == 0) - update_intrname(irq, head->devdata); + if (head != NULL) { + if (head->next != NULL) { + /* install the multiplex handler with new list head as argument */ + errcode = icu_setup(irq, intr_mux, head, 0, 0); + if (errcode == 0) + update_intrname(irq, -1); + } else { + /* install the one remaining handler for this irq */ + errcode = icu_setup(irq, head->handler, + head->argument, + head->maskptr, head->flags); + if (errcode == 0) + update_intrname(irq, head->devdata); + } } splx(oldspl); } |