Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 065c8986 authored by Arun Kumar Neelakantam's avatar Arun Kumar Neelakantam Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarArun Kumar Neelakantam <aneela@codeaurora.org>
parent 3eb9c77d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -809,9 +809,9 @@ static int qcom_smd_channel_open(struct qcom_smd_channel *channel,
	size_t bb_size;

	/*
	 * 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;