From 1b5581c8d9a149bd28a74615bb416c7c7341d570 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 23 Aug 2016 13:22:17 -0500 Subject: 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 Reviewed-on: https://review.coreboot.org/16303 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Paul Menzel --- src/vboot/vbnv_flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.2.3