syslog_rpmsg: head must bigger then tail when syslog_rpmsg_init

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2022-04-12 15:35:26 +08:00 committed by Xiang Xiao
parent 2291f601ee
commit 5c33db4220
1 changed files with 4 additions and 0 deletions

View File

@ -420,6 +420,10 @@ void syslog_rpmsg_init_early(FAR void *buffer, size_t size)
{ {
priv->head = priv->tail = 0; priv->head = priv->tail = 0;
} }
else if (priv->head < priv->tail)
{
priv->head += priv->size;
}
} }
int syslog_rpmsg_init(void) int syslog_rpmsg_init(void)