Skip to content

Commit 1e23e86

Browse files
committed
Do not run uacpi_state_reset() on exitbs unless uACPI was fully initialised
1 parent 72cf390 commit 1e23e86

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/acpi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ bool acpi_init(struct csmwrap_priv *priv) {
406406
return false;
407407
}
408408

409+
static bool fully_initialized = false;
410+
409411
bool acpi_full_init(void) {
410412
enum uacpi_status uacpi_status;
411413

@@ -432,11 +434,15 @@ bool acpi_full_init(void) {
432434
early_table_buffer = NULL;
433435
}
434436

437+
fully_initialized = true;
438+
435439
return true;
436440
}
437441

438442
void acpi_prepare_exitbs(void) {
439-
uacpi_state_reset();
443+
if (fully_initialized) {
444+
uacpi_state_reset();
445+
}
440446

441447
if (early_table_buffer != NULL) {
442448
gBS->FreePool(early_table_buffer);

0 commit comments

Comments
 (0)