diff options
author | Martin Roth <martinroth@chromium.org> | 2016-08-15 14:22:02 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-10-25 14:47:07 -0700 |
commit | 53b80c8a086da24b293093a49875715b491839fc (patch) | |
tree | 7ca0a5c3085061f0fb27c86962d2ebea0821ff5f /chip/g/flash.c | |
parent | f140370353d7ed8a540c6a84d8d6a5faab89adaa (diff) | |
download | chrome-ec-53b80c8a086da24b293093a49875715b491839fc.tar.gz |
chip/g/flash: Return error if flash command isn't recognized
This fixes a build failure using gcc 5.3 where opcode and max_attempts
are used before being initialized.
BUG=None
BRANCH=None
TEST=Build all boards successfully.
Change-Id: Ia7c4273f8812cca9f127fcd71101ce3a4e4ad4c7
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/370662
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Nagendra Modadugu <ngm@google.com>
Diffstat (limited to 'chip/g/flash.c')
-rw-r--r-- | chip/g/flash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chip/g/flash.c b/chip/g/flash.c index 870f76ef34..f0bd8e1529 100644 --- a/chip/g/flash.c +++ b/chip/g/flash.c @@ -191,6 +191,8 @@ static int do_flash_op(enum flash_op op, int is_info_bank, words = 1; max_attempts = 9; break; + default: + return EC_ERROR_INVAL; } /* |