From 0bdaf5c804f852fe21f6172e436524157c9f6919 Mon Sep 17 00:00:00 2001 From: Manorit Chawdhry Date: Wed, 17 Jan 2024 15:06:58 +0530 Subject: [PATCH] fix(k3): increment while reading trail bytes The trail bytes from the secure proxy driver were being overwritten, increase the count each time to not overwrite the existing data and not get the end data corrupted from secure proxy. Fixes: d76fdd33e011 ("ti: k3: drivers: Add Secure Proxy driver") Change-Id: I8e23f8b6959da886d6ab43049746f78765ae1766 Signed-off-by: Manorit Chawdhry --- plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c b/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c index 1bed229b7..fb27336e0 100644 --- a/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c +++ b/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c @@ -320,7 +320,7 @@ int k3_sec_proxy_recv(enum k3_sec_proxy_chan_id id, struct k3_sec_proxy_msg *msg i = msg->len - trail_bytes; while (trail_bytes--) { - msg->buf[i] = data_trail & 0xff; + msg->buf[i++] = data_trail & 0xff; data_trail >>= 8; } }