summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/flash_commands.c3
-rw-r--r--common/host_command.c2
-rw-r--r--common/pstore_commands.c2
3 files changed, 2 insertions, 5 deletions
diff --git a/common/flash_commands.c b/common/flash_commands.c
index d8953bc3c7..590e090b0e 100644
--- a/common/flash_commands.c
+++ b/common/flash_commands.c
@@ -207,9 +207,6 @@ static int flash_command_read(struct host_cmd_handler_args *args)
const struct ec_params_flash_read *p =
(const struct ec_params_flash_read *)args->params;
- if (p->size > EC_PARAM_SIZE)
- return EC_RES_INVALID_PARAM;
-
if (flash_dataptr(p->offset, p->size, 1, (char **)&args->response) < 0)
return EC_RES_ERROR;
diff --git a/common/host_command.c b/common/host_command.c
index 716119b909..3e0ea06d5d 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -146,7 +146,7 @@ static int host_command_read_memmap(struct host_cmd_handler_args *args)
uint8_t offset = p->offset;
uint8_t size = p->size;
- if (size > EC_PARAM_SIZE || offset > EC_MEMMAP_SIZE ||
+ if (size > EC_MEMMAP_SIZE || offset > EC_MEMMAP_SIZE ||
offset + size > EC_MEMMAP_SIZE)
return EC_RES_INVALID_PARAM;
diff --git a/common/pstore_commands.c b/common/pstore_commands.c
index 9717d3ccdb..4b09c9bfcd 100644
--- a/common/pstore_commands.c
+++ b/common/pstore_commands.c
@@ -37,7 +37,7 @@ int pstore_command_read(struct host_cmd_handler_args *args)
int offset = p->offset % block_size;
int bytes_left = p->size;
- if (p->size > sizeof(EC_PARAM_SIZE))
+ if (p->size > args->response_max)
return EC_RES_INVALID_PARAM;
while (bytes_left) {