summaryrefslogtreecommitdiff
path: root/src/vboot/vbnv_flash.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-08-23 13:22:17 -0500
committerAaron Durbin <adurbin@chromium.org>2016-08-24 00:09:23 +0200
commit1b5581c8d9a149bd28a74615bb416c7c7341d570 (patch)
tree52bd4ffda25b6c520e0da49f97a3476a8f9d05fa /src/vboot/vbnv_flash.c
parenta73a803bcd79730deac47f9f8e87a232c96432b0 (diff)
downloadcoreboot-1b5581c8d9a149bd28a74615bb416c7c7341d570.tar.xz
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>
Diffstat (limited to 'src/vboot/vbnv_flash.c')
-rw-r--r--src/vboot/vbnv_flash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vboot/vbnv_flash.c b/src/vboot/vbnv_flash.c
index d061228a2a..81c4f087af 100644
--- a/src/vboot/vbnv_flash.c
+++ b/src/vboot/vbnv_flash.c
@@ -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 */
ctx->blob_offset = new_offset;
memcpy(ctx->cache, vbnv_copy, BLOB_SIZE);