summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorErik Schmauss <erik.schmauss@intel.com>2018-03-14 16:13:08 -0700
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-03-18 19:29:46 +0100
commitb4c0de312613ca676db5bd7e696a44b56795612a (patch)
tree3bdf014649fb5eafc97a167b3f5926ce1ce45226 /drivers/acpi/acpica
parent95857638889aeea1b10a16b55041adf3e3ab84c4 (diff)
downloadop-kernel-dev-b4c0de312613ca676db5bd7e696a44b56795612a.zip
op-kernel-dev-b4c0de312613ca676db5bd7e696a44b56795612a.tar.gz
ACPICA: Events: add a return on failure from acpi_hw_register_read
This ensures that acpi_ev_fixed_event_detect() does not use fixed_status and and fixed_enable as uninitialized variables. Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r--drivers/acpi/acpica/evevent.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c
index 36a243e..b3d07cc 100644
--- a/drivers/acpi/acpica/evevent.c
+++ b/drivers/acpi/acpica/evevent.c
@@ -170,6 +170,7 @@ u32 acpi_ev_fixed_event_detect(void)
u32 fixed_status;
u32 fixed_enable;
u32 i;
+ acpi_status status;
ACPI_FUNCTION_NAME(ev_fixed_event_detect);
@@ -177,8 +178,12 @@ u32 acpi_ev_fixed_event_detect(void)
* Read the fixed feature status and enable registers, as all the cases
* depend on their values. Ignore errors here.
*/
- (void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
- (void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
+ status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
+ status |=
+ acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
+ if (ACPI_FAILURE(status)) {
+ return (int_status);
+ }
ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
"Fixed Event Block: Enable %08X Status %08X\n",
OpenPOWER on IntegriCloud