Skip to content

Commit

Permalink
fix null ptr in init_madt
Browse files Browse the repository at this point in the history
Signed-off-by: Daniele Ahmed <[email protected]>
  • Loading branch information
82marbag authored and dkgupta-amzn committed Nov 15, 2021
1 parent 5902578 commit 9c1e2da
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 9c1e2da

Please sign in to comment.