mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 07:02:34 +02:00
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/+/62616 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
parent
f9b8fece4f
commit
2386e94850
2
dmi.c
2
dmi.c
@ -169,7 +169,7 @@ static void dmi_table(uint32_t base, uint16_t len, uint16_t num)
|
|||||||
int i = 0, j = 0;
|
int i = 0, j = 0;
|
||||||
|
|
||||||
uint8_t *dmi_table_mem = physmap_ro("DMI Table", base, len);
|
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");
|
msg_perr("Unable to access DMI Table\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user