vboot/vbnv_flash: fix return value check for rdev_writeat()

The return value check was incorect and checking for failure
in the success path. Fix the return value check so that it
actually checks for success.

BUG=chrome-os-partner:56151

Change-Id: Ie7960b89a916dec261015c97c3e0552be56b5b5d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/16303
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Aaron Durbin 2016-08-23 13:22:17 -05:00
parent a73a803bcd
commit 1b5581c8d9
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ void save_vbnv_flash(const uint8_t *vbnv_copy)
} }
} }
if (rdev_writeat(rdev, vbnv_copy, new_offset, BLOB_SIZE) < 0) { if (rdev_writeat(rdev, vbnv_copy, new_offset, BLOB_SIZE) == BLOB_SIZE) {
/* write was successful. safely move pointer forward */ /* write was successful. safely move pointer forward */
ctx->blob_offset = new_offset; ctx->blob_offset = new_offset;
memcpy(ctx->cache, vbnv_copy, BLOB_SIZE); memcpy(ctx->cache, vbnv_copy, BLOB_SIZE);