Commit 3e1c715e authored by Tzung-Bi Shih's avatar Tzung-Bi Shih

platform/chrome: cros_ec_proto: return -EPROTO if empty payload

cros_ec_wait_until_complete() sends EC_CMD_GET_COMMS_STATUS which expects
to receive sizeof(struct ec_response_get_comms_status) from
cros_ec_xfer_command().

Return -EPROTO if cros_ec_xfer_command() returns 0.
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220718050914.2267370-11-tzungbi@kernel.org
parent 82c9b7ed
......@@ -163,6 +163,11 @@ static int cros_ec_wait_until_complete(struct cros_ec_device *ec_dev, uint32_t *
if (msg->result != EC_RES_SUCCESS)
return ret;
if (ret == 0) {
ret = -EPROTO;
break;
}
if (!(status->flags & EC_COMMS_STATUS_PROCESSING))
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment