Anastasia Klimchuk submitted this change.
ichspi.c: Bug fix for ich_hwseq_get_flash_id
In ich_hwseq_get_flash_id, flash_id_to_entry would return
address of a structure present in flashchips array
corresponding to provided manufacture_id and model_id.
If this function returns NULL and if we don't return
after printing the warning using msg_pwarn, we'll be
dereferencing a NULL pointer, hence the return in that
if is provided.
Change-Id: I35c112cd032e3b94e30c347766764392d5bbfe3d
Signed-off-by: Eshan Kelkar <eshangalorithm@gmail.com>
Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/71872
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
---
M ichspi.c
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/ichspi.c b/ichspi.c
index e9668ef..2e38ff1 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1566,6 +1566,7 @@
if (!entry) {
msg_pwarn("Unable to identify chip, mfg_id: 0x%02"PRIx32", "
"model_id: 0x%02"PRIx32"\n", mfg_id, model_id);
+ return;
}
msg_pdbg("Chip identified: %s\n", entry->name);
To view, visit change 71872. To unsubscribe, or for help writing mail filters, visit settings.