Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/external/bsd/acpica/dist/compiler/dtcompile.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/external/bsd/acpica/dist/compiler/dtcompile.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.10 retrieving revision 1.11 diff -u -p -r1.10 -r1.11 --- src/sys/external/bsd/acpica/dist/compiler/dtcompile.c 2017/11/12 03:02:35 1.10 +++ src/sys/external/bsd/acpica/dist/compiler/dtcompile.c 2018/04/07 15:49:50 1.11 @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2017, Intel Corp. + * Copyright (C) 2000 - 2018, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -346,7 +346,7 @@ DtCompileDataTable ( DtInsertCompilerIds (*FieldList); Status = DtCompileTable (FieldList, AcpiDmTableInfoHeader, - &Gbl_RootTable, TRUE); + &Gbl_RootTable); if (ACPI_FAILURE (Status)) { return (Status); @@ -385,7 +385,7 @@ DtCompileDataTable ( { Subtable = NULL; Status = DtCompileTable (FieldList, TableData->TableInfo, - &Subtable, TRUE); + &Subtable); if (ACPI_FAILURE (Status)) { return (Status); @@ -424,7 +424,6 @@ FinishHeader: * PARAMETERS: Field - Current field list pointer * Info - Info table for this ACPI table * RetSubtable - Compile result of table - * Required - If this subtable must exist * * RETURN: Status * @@ -436,8 +435,7 @@ ACPI_STATUS DtCompileTable ( DT_FIELD **Field, ACPI_DMTABLE_INFO *Info, - DT_SUBTABLE **RetSubtable, - BOOLEAN Required) + DT_SUBTABLE **RetSubtable) { DT_FIELD *LocalField; UINT32 Length; @@ -452,10 +450,18 @@ DtCompileTable ( ACPI_STATUS Status = AE_OK; - if (!Field || !*Field) + if (!Field) { return (AE_BAD_PARAMETER); } + if (!*Field) + { + /* + * The field list is empty, this means that we are out of fields to + * parse. In other words, we are at the end of the table. + */ + return (AE_END_OF_TABLE); + } /* Ignore optional subtable if name does not match */ @@ -567,19 +573,19 @@ DtCompileTable ( case ACPI_DMT_GAS: Status = DtCompileTable (Field, AcpiDmTableInfoGas, - &InlineSubtable, TRUE); + &InlineSubtable); break; case ACPI_DMT_HESTNTFY: Status = DtCompileTable (Field, AcpiDmTableInfoHestNotify, - &InlineSubtable, TRUE); + &InlineSubtable); break; case ACPI_DMT_IORTMEM: Status = DtCompileTable (Field, AcpiDmTableInfoIortAcc, - &InlineSubtable, TRUE); + &InlineSubtable); break; default: @@ -668,7 +674,7 @@ DtCompileTwoSubtables ( DT_FIELD **PFieldList = (DT_FIELD **) List; - Status = DtCompileTable (PFieldList, TableInfo1, &Subtable, TRUE); + Status = DtCompileTable (PFieldList, TableInfo1, &Subtable); if (ACPI_FAILURE (Status)) { return (Status); @@ -679,7 +685,7 @@ DtCompileTwoSubtables ( while (*PFieldList) { - Status = DtCompileTable (PFieldList, TableInfo2, &Subtable, FALSE); + Status = DtCompileTable (PFieldList, TableInfo2, &Subtable); if (ACPI_FAILURE (Status)) { return (Status);