From 5c33db422053f63bb4b5aae1ea82855a9fb75512 Mon Sep 17 00:00:00 2001 From: ligd Date: Tue, 12 Apr 2022 15:35:26 +0800 Subject: [PATCH] syslog_rpmsg: head must bigger then tail when syslog_rpmsg_init Signed-off-by: ligd --- drivers/syslog/syslog_rpmsg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c index 271d5a122f..bb5e702358 100644 --- a/drivers/syslog/syslog_rpmsg.c +++ b/drivers/syslog/syslog_rpmsg.c @@ -420,6 +420,10 @@ void syslog_rpmsg_init_early(FAR void *buffer, size_t size) { priv->head = priv->tail = 0; } + else if (priv->head < priv->tail) + { + priv->head += priv->size; + } } int syslog_rpmsg_init(void)