Skip to content

Commit bf9b263

Browse files
Erik Schmaussgregkh
authored andcommitted
ACPICA: Events: add a return on failure from acpi_hw_register_read
[ Upstream commit b4c0de3 ] 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 601ae35 commit bf9b263

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
@@ -204,15 +204,20 @@ u32 acpi_ev_fixed_event_detect(void)
204204
u32 fixed_status;
205205
u32 fixed_enable;
206206
u32 i;
207+
acpi_status status;
207208

208209
ACPI_FUNCTION_NAME(ev_fixed_event_detect);
209210

210211
/*
211212
* Read the fixed feature status and enable registers, as all the cases
212213
* depend on their values. Ignore errors here.
213214
*/
214-
(void)acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
215-
(void)acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
215+
status = acpi_hw_register_read(ACPI_REGISTER_PM1_STATUS, &fixed_status);
216+
status |=
217+
acpi_hw_register_read(ACPI_REGISTER_PM1_ENABLE, &fixed_enable);
218+
if (ACPI_FAILURE(status)) {
219+
return (int_status);
220+
}
216221

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

0 commit comments

Comments
 (0)