Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/fdt gic at fdt: Don't assume all irqs are estab...



details:   https://anonhg.NetBSD.org/src/rev/dd6877da79d0
branches:  trunk
changeset: 368884:dd6877da79d0
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Aug 11 13:04:35 2022 +0000

description:
gic at fdt: Don't assume all irqs are established on disestablish.

Fixes panic on detach of PCI devices on pcihost.

diffstat:

 sys/arch/arm/fdt/gic_fdt.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 040443244171 -r dd6877da79d0 sys/arch/arm/fdt/gic_fdt.c
--- a/sys/arch/arm/fdt/gic_fdt.c        Thu Aug 11 12:52:24 2022 +0000
+++ b/sys/arch/arm/fdt/gic_fdt.c        Thu Aug 11 13:04:35 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_fdt.c,v 1.24 2021/11/04 21:31:30 jakllsch Exp $ */
+/* $NetBSD: gic_fdt.c,v 1.25 2022/08/11 13:04:35 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "pci.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.24 2021/11/04 21:31:30 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.25 2022/08/11 13:04:35 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -328,7 +328,7 @@
 
        for (n = 0; n < GIC_MAXIRQ; n++) {
                firq = sc->sc_irq[n];
-               if (firq->intr_ih != ih)
+               if (firq == NULL || firq->intr_ih != ih)
                        continue;
 
                KASSERT(firq->intr_refcnt > 0);



Home | Main Index | Thread Index | Old Index