diff options
author | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2024-05-20 13:27:24 +0200 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2024-05-28 12:49:46 -0600 |
commit | 9dbd9962cfe56d210be5232349851420b5f9c8f6 (patch) | |
tree | 8f4cfed7e665d4a4e38f9a363d50eac93495b9b3 /drivers/remoteproc/mtk_scp.c | |
parent | 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 (diff) | |
download | lwn-9dbd9962cfe56d210be5232349851420b5f9c8f6.tar.gz lwn-9dbd9962cfe56d210be5232349851420b5f9c8f6.zip |
remoteproc: mediatek: Zero out only remaining bytes of IPI buffer
In scp_ipi_handler(), instead of zeroing out the entire shared
buffer, which may be as large as 600 bytes, overwrite it with the
received data, then zero out only the remaining bytes.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20240520112724.139945-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/remoteproc/mtk_scp.c')
-rw-r--r-- | drivers/remoteproc/mtk_scp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index b8498772dba1..b885a9a041e4 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -117,8 +117,8 @@ static void scp_ipi_handler(struct mtk_scp *scp) return; } - memset(scp->share_buf, 0, scp_sizes->ipi_share_buffer_size); memcpy_fromio(scp->share_buf, &rcv_obj->share_buf, len); + memset(&scp->share_buf[len], 0, scp_sizes->ipi_share_buffer_size - len); handler(scp->share_buf, len, ipi_desc[id].priv); scp_ipi_unlock(scp, id); |