summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <martinroth@chromium.org>2016-08-12 11:36:45 -0600
committerchrome-bot <chrome-bot@chromium.org>2016-08-23 15:36:48 -0700
commit866add68ed07458fb413f3d1a664139654c2768f (patch)
treeebc9cde41904238879c0135c314a01c7c2654125
parent862a325fa02357cd9b88619865ce88281d573e93 (diff)
downloadchrome-ec-866add68ed07458fb413f3d1a664139654c2768f.tar.gz
npcx/flash.c: Init return value for success
In flash_physical_erase(), if the area being erased was already cleared, the return value would never be set, and would be returned without being defined. Initialize the value so that if the area being erased is clear, we return success. TEST=Build BUG=None BRANCH=None Change-Id: Ib13e0be0ad1d3ad23c065b407c35e7b5c4db8487 Signed-off-by: Martin Roth <martinroth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/371399 Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
-rw-r--r--chip/npcx/flash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/npcx/flash.c b/chip/npcx/flash.c
index 716be302c8..e889163088 100644
--- a/chip/npcx/flash.c
+++ b/chip/npcx/flash.c
@@ -605,7 +605,7 @@ int flash_physical_write(int offset, int size, const char *data)
int flash_physical_erase(int offset, int size)
{
- int rv;
+ int rv = EC_SUCCESS;
/* check protection */
if (all_protected)
return EC_ERROR_ACCESS_DENIED;