Skip to content

Commit

Permalink
mgmt: ec_host_cmd: set max response every command
Browse files Browse the repository at this point in the history
Update the response buffer size, passed to a command handler, every
command, since a backend could change it in runtime.

Signed-off-by: Dawid Niedzwiecki <[email protected]>
  • Loading branch information
niedzwiecki-dawid authored and carlescufi committed Jul 7, 2023
1 parent da95a40 commit f2d6e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ FUNC_NORETURN static void ec_host_cmd_thread(void *hc_handle, void *arg2, void *
/* The pointer to rx buffer is constant during communication */
struct ec_host_cmd_handler_args args = {
.output_buf = (uint8_t *)tx->buf + TX_HEADER_SIZE,
.output_buf_max = tx->len_max - TX_HEADER_SIZE,
.input_buf = rx->buf + RX_HEADER_SIZE,
.reserved = NULL,
};
Expand Down Expand Up @@ -266,6 +265,7 @@ FUNC_NORETURN static void ec_host_cmd_thread(void *hc_handle, void *arg2, void *
args.command = rx_header->cmd_id;
args.version = rx_header->cmd_ver;
args.input_buf_size = rx_header->data_len;
args.output_buf_max = tx->len_max - TX_HEADER_SIZE,
args.output_buf_size = 0;

status = validate_handler(found_handler, &args);
Expand Down

0 comments on commit f2d6e0f

Please sign in to comment.