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 avoid NULL deref in gicv3_fdt_disestablish()



details:   https://anonhg.NetBSD.org/src/rev/87e9fa2334cc
branches:  trunk
changeset: 445988:87e9fa2334cc
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Mon Nov 19 13:54:15 2018 +0000

description:
avoid NULL deref in gicv3_fdt_disestablish()

diffstat:

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

diffs (27 lines):

diff -r 5757a5898dc6 -r 87e9fa2334cc sys/arch/arm/fdt/gicv3_fdt.c
--- a/sys/arch/arm/fdt/gicv3_fdt.c      Mon Nov 19 13:28:48 2018 +0000
+++ b/sys/arch/arm/fdt/gicv3_fdt.c      Mon Nov 19 13:54:15 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_fdt.c,v 1.4 2018/11/10 01:24:06 jmcneill Exp $ */
+/* $NetBSD: gicv3_fdt.c,v 1.5 2018/11/19 13:54:15 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2015-2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #define        _INTR_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.4 2018/11/10 01:24:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.5 2018/11/19 13:54:15 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -310,7 +310,7 @@
 
        for (n = 0; n < GICV3_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