Skip to content

Commit b4c0de3

Browse files
Erik Schmaussrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 9585763 commit b4c0de3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/acpi/acpica/evevent.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,20 @@ u32 acpi_ev_fixed_event_detect(void)
170170
u32 fixed_status;
171171
u32 fixed_enable;
172172
u32 i;
173+
acpi_status status;
173174

174175
ACPI_FUNCTION_NAME(ev_fixed_event_detect);
175176

176177
/*
177178
* Read the fixed feature status and enable registers, as all the cases
178179
* depend on their values. Ignore errors here.
179180
*/
180-
(void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
181-
(void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
181+
status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
182+
status |=
183+
acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
184+
if (ACPI_FAILURE(status)) {
185+
return (int_status);
186+
}
182187

183188
ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
184189
"Fixed Event Block: Enable %08X Status %08X\n",

0 commit comments

Comments
 (0)