Evgeny Zinoviev has uploaded this change for review.

View Change

Fix segfault when iomem=strict

As I can see, physmap_common() only returns ERROR_PTR or a real pointer
but never NULL.

Tested on Linux 5.9.12.

Change-Id: I5b11957fc10fd5c7a4fbb7f54fb94d791590f373
Signed-off-by: Evgeny Zinoviev <me@ch1p.io>
---
M dmi.c
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/61/48361/1
diff --git a/dmi.c b/dmi.c
index c44221c..7488d61 100644
--- a/dmi.c
+++ b/dmi.c
@@ -164,7 +164,7 @@
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;
}

To view, visit change 48361. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5b11957fc10fd5c7a4fbb7f54fb94d791590f373
Gerrit-Change-Number: 48361
Gerrit-PatchSet: 1
Gerrit-Owner: Evgeny Zinoviev <me@ch1p.io>
Gerrit-MessageType: newchange