From d323f0cf000f1d999bf78d89c0037af76b6bf8d8 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Thu, 12 May 2022 16:47:21 +0200 Subject: [PATCH] fix(scmi-msg): base: fix protocol list response size Corrects the size of the SCMI response payload when querying the list of the supported protocol. This response payload size depends on the number of protocols enumerated by the response. Change-Id: Ib01eb5cec6c6656dfd7d88ccdd5a720c1deee7a3 Reported-by: Nicolas Frattaroli Signed-off-by: Etienne Carriere --- drivers/scmi-msg/base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scmi-msg/base.c b/drivers/scmi-msg/base.c index 2d7203451..522819c09 100644 --- a/drivers/scmi-msg/base.c +++ b/drivers/scmi-msg/base.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BSD-3-Clause /* * Copyright (c) 2015-2019, Arm Limited and Contributors. All rights reserved. - * Copyright (c) 2019-2020, Linaro Limited + * Copyright (c) 2019-2022, Linaro Limited */ #include #include @@ -165,7 +165,7 @@ static void discover_list_protocols(struct scmi_msg *msg) memcpy(outargs, &p2a, sizeof(p2a)); memcpy(outargs + sizeof(p2a), list + a2p->skip, count); - scmi_write_response(msg, outargs, sizeof(outargs)); + scmi_write_response(msg, outargs, sizeof(p2a) + round_up(count, sizeof(uint32_t))); } static const scmi_msg_handler_t scmi_base_handler_table[] = {