summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2022-03-06 00:21:52 +0100
committerNico Huber <nico.h@gmx.de>2022-03-07 16:44:51 +0000
commit4f6aa94f00404dae91cb90520d8d411903c7d4b5 (patch)
treea80b3bf17ee7d1b7d4332d9ea16bf64b88b2681a
parent8c3de0154887c4355aaa4dd4141b458748438ed8 (diff)
downloadflashrom-4f6aa94f00404dae91cb90520d8d411903c7d4b5.tar.gz
flashrom-4f6aa94f00404dae91cb90520d8d411903c7d4b5.tar.bz2
flashrom-4f6aa94f00404dae91cb90520d8d411903c7d4b5.zip
dmi: Correctly check for ERROR_PTR
For the physmap*() functions, NULL is considered valid return value. Fixes a segmentation fault when DMI tables can't be mapped. Tested on intel/eblake board with broken coreboot. Change-Id: Ic403c2940c2b91acbd113f0acfa3ce9ef6c6bb6c Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/62613 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r--dmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dmi.c b/dmi.c
index 79321ce20..cea07f865 100644
--- a/dmi.c
+++ b/dmi.c
@@ -164,7 +164,7 @@ static void dmi_table(uint32_t base, uint16_t len, uint16_t num)
int i = 0, j = 0;
uint8_t *dmi_table_mem = physmap_ro("DMI Table", base, len);
- if (dmi_table_mem == NULL) {
+ if (dmi_table_mem == ERROR_PTR) {
msg_perr("Unable to access DMI Table\n");
return;
}