summaryrefslogtreecommitdiffstats
path: root/dmi.c
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-08 21:50:00 +0000
commitfd4cb2d7b472393cb534218510f22969f931c4cb (patch)
tree85aa7e2c32e111c5a28111e48124ff75e48e0787 /dmi.c
parent11680db4e1251eb842bee11e53b6d1f0ae67767b (diff)
downloadflashrom-fd4cb2d7b472393cb534218510f22969f931c4cb.tar.gz
flashrom-fd4cb2d7b472393cb534218510f22969f931c4cb.tar.bz2
flashrom-fd4cb2d7b472393cb534218510f22969f931c4cb.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/+/62611 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'dmi.c')
-rw-r--r--dmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dmi.c b/dmi.c
index 16d350df4..a7b300dad 100644
--- a/dmi.c
+++ b/dmi.c
@@ -164,7 +164,7 @@ static void dmi_table(uint32_t base, uint16_t len, uint16_t num)
unsigned 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;
}