uart_rpmsg: fix data loss

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2021-12-31 15:22:50 +08:00 committed by Xiang Xiao
parent b4d2944df7
commit dce8c96281

View File

@ -255,7 +255,7 @@ static void uart_rpmsg_dmasend(FAR struct uart_dev_s *dev)
if (len > xfer->length) if (len > xfer->length)
{ {
memcpy(msg->data, xfer->buffer, xfer->length); memcpy(msg->data, xfer->buffer, xfer->length);
memcpy(msg->data, xfer->nbuffer, len - xfer->length); memcpy(msg->data + xfer->length, xfer->nbuffer, len - xfer->length);
} }
else else
{ {