]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ACPICA: Events: add a return on failure from acpi_hw_register_read
authorErik Schmauss <erik.schmauss@intel.com>
Wed, 14 Mar 2018 23:13:08 +0000 (16:13 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit b4c0de312613ca676db5bd7e696a44b56795612a ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/acpi/acpica/evevent.c

index d3b6b314fa5070012b65ac6431c0ee137e2966f9..37b0b4c04220da4ad5d81975e75c37ad169a405a 100644 (file)
@@ -204,6 +204,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);
 
@@ -211,8 +212,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",