diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-08-03 01:08:14 +0200 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-12-05 18:36:15 +0000 |
commit | 67b3c8f278312768a25f0ad07569e22288d0a11f (patch) | |
tree | 14ef2fb7100c5dd398163c4dff87f43aa6d3e73d /src | |
parent | 372dfe0e20f7e56ba2acf872392da41f5ee28633 (diff) |
acpi/acpi: make sure that table_ptr is non-NULL in acpidump_print
While acpidump_print shouldn't be called with a NULL pointer as
table_ptr argument, better add a check to not end up dereferencing the
NULL pointer.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ic3cc103c8a47fb8c2fe4262236ea47013af27c4f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79393
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/acpi/acpi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index e40d4ac9aa..c4d55ab453 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -1367,6 +1367,8 @@ static void acpixtract_compatible_hexdump(const void *memory, size_t length) static void acpidump_print(void *table_ptr) { + if (table_ptr == NULL) + return; const acpi_header_t *header = (acpi_header_t *)table_ptr; const size_t table_size = header->length; printk(BIOS_SPEW, "%.4s @ 0x0000000000000000\n", header->signature); |