Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix null ptr in init_madt #226

Merged
merged 2 commits into from
Nov 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion common/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,12 @@ static ACPI_STATUS init_fadt(void) {
static ACPI_STATUS init_madt(unsigned bsp_cpu_id) {
ACPI_TABLE_MADT *madt = acpi_find_table(ACPI_SIG_MADT);
ACPI_SUBTABLE_HEADER *subtbl = (void *) madt + sizeof(*madt);
uint32_t length = madt->Header.Length - sizeof(*madt);

if (!madt || !subtbl)
return AE_ERROR;

uint32_t length = madt->Header.Length - sizeof(*madt);

acpi_walk_subtables(subtbl, length, madt_parser, (void *) _ul(bsp_cpu_id));
return AE_OK;
}
Expand Down