Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Stop walking MADT / GTDT subtables if we hit a ...



details:   https://anonhg.NetBSD.org/src/rev/c9b25822c189
branches:  trunk
changeset: 970975:c9b25822c189
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Apr 09 10:46:19 2020 +0000

description:
Stop walking MADT / GTDT subtables if we hit a header with length 0

diffstat:

 sys/dev/acpi/acpi.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 5399ebc2346b -r c9b25822c189 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Thu Apr 09 08:55:45 2020 +0000
+++ b/sys/dev/acpi/acpi.c       Thu Apr 09 10:46:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.283 2020/01/17 17:06:32 jmcneill Exp $      */
+/*     $NetBSD: acpi.c,v 1.284 2020/04/09 10:46:19 jmcneill Exp $      */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.283 2020/01/17 17:06:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.284 2020/04/09 10:46:19 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -1809,7 +1809,7 @@
 
                hdrp = (ACPI_SUBTABLE_HEADER *)where;
 
-               if (ACPI_FAILURE(func(hdrp, aux)))
+               if (hdrp->Length == 0 || ACPI_FAILURE(func(hdrp, aux)))
                        break;
 
                where += hdrp->Length;
@@ -1829,7 +1829,7 @@
 
                hdrp = (ACPI_GTDT_HEADER *)where;
 
-               if (ACPI_FAILURE(func(hdrp, aux)))
+               if (hdrp->Length == 0 || ACPI_FAILURE(func(hdrp, aux)))
                        break;
 
                where += hdrp->Length;



Home | Main Index | Thread Index | Old Index