From 13ce68c2db30bd91e1ecd795e18b8d0cdf2f1938 Mon Sep 17 00:00:00 2001 From: Mandar Mahesh Kamble Date: Wed, 8 May 2024 17:02:25 +0530 Subject: [PATCH] rpmsg: qcom_smd: increase bounce buffer size Bounce buffer size is 4K, which cause buffer overflow when incoming packet size greater than 4k and packet is wrap around in FIFO. To avoid buffer overflow use bounce buffer size same as FIFO size. Change-Id: Ia23adda1de2bd6613def844fc88a565587bcd82d Signed-off-by: Arun Kumar Neelakantam Signed-off-by: Mandar Mahesh Kamble --- drivers/rpmsg/qcom_smd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c index 1044cf03c542..ee4d9591dc81 100644 --- a/drivers/rpmsg/qcom_smd.c +++ b/drivers/rpmsg/qcom_smd.c @@ -820,9 +820,9 @@ static int qcom_smd_channel_open(struct qcom_smd_channel *channel, int ret; /* - * Packets are maximum 4k, but reduce if the fifo is smaller + * Packets are maximum 8k, but reduce if the fifo is smaller */ - bb_size = min(channel->fifo_size, SZ_4K); + bb_size = min(channel->fifo_size, SZ_8K); channel->bounce_buffer = kmalloc(bb_size, GFP_KERNEL); if (!channel->bounce_buffer) return -ENOMEM;