vboot: fix invalid check for the returned value from spi_flash->write
spi_flash->write returns non-zero on error and zero on success, not the number of bytes written. BUG=none BRANCH=ToT TEST=Booted storm. Verified successfully nvdata was saved. Change-Id: If50cc1a62a4f06398d1830cca60085b6f925fff3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/229389 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
parent
698d38b53b
commit
1e8cdbdb07
1 changed files with 1 additions and 2 deletions
|
|
@ -175,8 +175,7 @@ void save_vbnv(const uint8_t *vbnv_copy)
|
|||
if (vbnv_flash_probe())
|
||||
return; /* error */
|
||||
|
||||
if (spi_flash->write(spi_flash, new_offset,
|
||||
BLOB_SIZE, vbnv_copy) != BLOB_SIZE) {
|
||||
if (spi_flash->write(spi_flash, new_offset, BLOB_SIZE, vbnv_copy)) {
|
||||
printk(BIOS_ERR, "failed to write nvdata\n");
|
||||
return; /* error */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue