summaryrefslogtreecommitdiff
path: root/common/virtual_battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/virtual_battery.c')
-rw-r--r--common/virtual_battery.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/common/virtual_battery.c b/common/virtual_battery.c
index 743f2a8801..adb4e96d7f 100644
--- a/common/virtual_battery.c
+++ b/common/virtual_battery.c
@@ -103,6 +103,9 @@ int virtual_battery_handler(struct ec_response_i2c_passthru *resp, int in_len,
if (cache_hit)
*err_code = 0;
break;
+ default:
+ reset_parse_state();
+ return EC_ERROR_INVAL;
}
acc_write_len += write_len;
@@ -126,15 +129,10 @@ int virtual_battery_handler(struct ec_response_i2c_passthru *resp, int in_len,
read_len, 0);
}
break;
- /* LCOV_EXCL_START - Unreachable in IDLE state and remaining
- * states covered above.
- */
default:
reset_parse_state();
return EC_ERROR_INVAL;
}
- /* LCOV_EXCL_STOP */
-
/* Reset the state in the end of messages */
reset_parse_state();
}