mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +02:00
flashrom.c: Drop redundant chip read validation in verify_range()
The 'chip_safety_check()' already validates the chip structure within 'prepare_flash_access()' before all subsequent chip operations such as 'verify_range()' and therefore the chip structure is guaranteed to be valid in the domain of those operations. BUG=none BRANCH=none TEST=builds Change-Id: Ifc57dd89715115e03d013691352463a8b3c0dc52 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/69471 Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
347dba5414
commit
7c976e3463
@ -511,11 +511,6 @@ int verify_range(struct flashctx *flash, const uint8_t *cmpbuf, unsigned int sta
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!lookup_read_func_ptr(flash->chip)) {
|
|
||||||
msg_cerr("ERROR: flashrom has no read function for this flash chip.\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t *readbuf = malloc(len);
|
uint8_t *readbuf = malloc(len);
|
||||||
if (!readbuf) {
|
if (!readbuf) {
|
||||||
msg_gerr("Could not allocate memory!\n");
|
msg_gerr("Could not allocate memory!\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user