From f2d6e0f6607ee180feee78c6a1b4d6bb08a9c0e0 Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Mon, 19 Jun 2023 09:02:12 +0000 Subject: [PATCH] mgmt: ec_host_cmd: set max response every command 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 --- subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c b/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c index 6e4b96396d4dc0..ff3b428ce589b6 100644 --- a/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c +++ b/subsys/mgmt/ec_host_cmd/ec_host_cmd_handler.c @@ -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, }; @@ -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);