From 02e437962289b4b938d1059c00e6d50a6e1a11c3 Mon Sep 17 00:00:00 2001 From: Erik Schmauss Date: Fri, 9 Mar 2018 10:21:29 -0800 Subject: Events: add a return on failure from AcpiHwRegisterRead This ensures that AcpiEvFixedEventDetect does not use FixedStatus and and FixedEnable as uninitialized variables. Signed-off-by: Erik Schmauss --- source/components/events/evevent.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/components/events') diff --git a/source/components/events/evevent.c b/source/components/events/evevent.c index 755ab9935..791ee57eb 100644 --- a/source/components/events/evevent.c +++ b/source/components/events/evevent.c @@ -344,6 +344,7 @@ AcpiEvFixedEventDetect ( UINT32 FixedStatus; UINT32 FixedEnable; UINT32 i; + ACPI_STATUS Status; ACPI_FUNCTION_NAME (EvFixedEventDetect); @@ -353,8 +354,12 @@ AcpiEvFixedEventDetect ( * Read the fixed feature status and enable registers, as all the cases * depend on their values. Ignore errors here. */ - (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus); - (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable); + Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus); + Status |= AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable); + if (ACPI_FAILURE (Status)) + { + return (IntStatus); + } ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, "Fixed Event Block: Enable %08X Status %08X\n", -- cgit v1.2.1