From eac6480a2c9056b38639948a9c467a814bea682d Mon Sep 17 00:00:00 2001 From: Shaunak Saha Date: Wed, 9 Dec 2015 22:39:27 -0800 Subject: [PATCH] mec1322: Fix uninitialized variable. This patch fixes a reported error for an uninitialized return variable. BUG=none TEST=Build and Test EC. BRANCH=none Change-Id: I43a6678049070ef1ee6c71dfbac1fcb21de88957 Signed-off-by: Shaunak Saha Reviewed-on: https://chromium-review.googlesource.com/317352 Commit-Ready: Divya Jyothi Tested-by: Divya Jyothi Reviewed-by: Shawn N --- chip/mec1322/flash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chip/mec1322/flash.c b/chip/mec1322/flash.c index 194926c15a..e1cbc3c589 100644 --- a/chip/mec1322/flash.c +++ b/chip/mec1322/flash.c @@ -36,7 +36,8 @@ struct flash_wp_state { */ int flash_physical_read(int offset, int size, char *data) { - int ret, i, read_size; + int ret = EC_SUCCESS; + int i, read_size; for (i = 0; i < size; i += read_size) { read_size = MIN((size - i), SPI_FLASH_MAX_READ_SIZE); @@ -63,7 +64,8 @@ int flash_physical_read(int offset, int size, char *data) */ int flash_physical_write(int offset, int size, const char *data) { - int ret, i, write_size; + int ret = EC_SUCCESS; + int i, write_size; if (entire_flash_locked) return EC_ERROR_ACCESS_DENIED;