Skip to content

Commit 9dbd996

Browse files
AngeloGioacchino Del Regnomathieupoirier
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 1613e60 commit 9dbd996

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/remoteproc/mtk_scp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ static void scp_ipi_handler(struct mtk_scp *scp)
117117
return;
118118
}
119119

120-
memset(scp->share_buf, 0, scp_sizes->ipi_share_buffer_size);
121120
memcpy_fromio(scp->share_buf, &rcv_obj->share_buf, len);
121+
memset(&scp->share_buf[len], 0, scp_sizes->ipi_share_buffer_size - len);
122122
handler(scp->share_buf, len, ipi_desc[id].priv);
123123
scp_ipi_unlock(scp, id);
124124

0 commit comments

Comments
 (0)