Skip to content

Commit 3e1c715

Browse files
author
Tzung-Bi Shih
committed
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: Guenter Roeck <groeck@chromium.org> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220718050914.2267370-11-tzungbi@kernel.org
1 parent 82c9b7e commit 3e1c715

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/platform/chrome/cros_ec_proto.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ static int cros_ec_wait_until_complete(struct cros_ec_device *ec_dev, uint32_t *
163163
if (msg->result != EC_RES_SUCCESS)
164164
return ret;
165165

166+
if (ret == 0) {
167+
ret = -EPROTO;
168+
break;
169+
}
170+
166171
if (!(status->flags & EC_COMMS_STATUS_PROCESSING))
167172
return ret;
168173
}

0 commit comments

Comments
 (0)