[PATCH] dmi: fix segfault when physmap_ro() fails to map DMI area
Nov. 27, 2019
11:10 p.m.
physmap_ro() returns ERROR_PTR and not NULL on failure. Change-Id: I365ebfeb985508253d3ec27f9d9f47491d77b7ed Signed-off-by: Sven Schnelle <svens@stackframe.org> --- dmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmi.c b/dmi.c index c44221c..7488d61 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; } -- 2.24.0
2515
Age (days ago)
2515
Last active (days ago)
0 comments
1 participants
participants (1)
-
Sven Schnelle