eshankelkar@galorithm.com has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/71872 )
Change subject: ichspi.c: Bug fix for ich_hwseq_get_flash_id ......................................................................
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 --- M ichspi.c 1 file changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/72/71872/1
diff --git a/ichspi.c b/ichspi.c index 1522d2b..a1c9a70 100644 --- a/ichspi.c +++ b/ichspi.c @@ -1565,6 +1565,7 @@ if (!entry) { msg_pwarn("Unable to identify chip, mfg_id: 0x%02x, " "model_id: 0x%02x\n", mfg_id, model_id); + return; }
msg_pdbg("Chip identified: %s\n", entry->name);