Skip to content

Commit

Permalink
helpers/sci: Gracefully ignore device with invalid _STA functions
Browse files Browse the repository at this point in the history
  • Loading branch information
thomtl committed Jul 30, 2023
1 parent 94c528f commit d51cd9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions helpers/sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,12 @@ int lai_evaluate_sta(lai_nsnode_t *node) {
lai_init_state(&state);

LAI_CLEANUP_VAR lai_variable_t result = LAI_VAR_INITIALIZER;
if (lai_eval(&result, handle, &state))
lai_panic("could not evaluate _STA");
lai_api_error_t err = lai_eval(&result, handle, &state);
if (err != LAI_ERROR_NONE) {
lai_warn("could not evaluate _STA, ignoring device");
return 0; // ACPI_STA_PRESENT is not set, so the device will be ignored
}

if (lai_obj_get_integer(&result, &sta))
lai_panic("_STA returned non-integer object");
}
Expand Down

0 comments on commit d51cd9d

Please sign in to comment.