This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 70b403c59bb0f7e6155ddaddd5b64a77184faacb Author: Bowen Wang <[email protected]> AuthorDate: Wed May 20 16:50:17 2026 +0800 drivers/syslog/syslog_rpmsg: always reset the buffer size on boot The size in the buffer header was only set when the magic was wrong. A buffer kept across a reboot in no-init memory therefore kept the size of the previous firmware, even if CONFIG_SYSLOG_RPMSG_BUFSIZE changed. Set the size before checking the magic. Signed-off-by: Bowen Wang <[email protected]> --- drivers/syslog/syslog_rpmsg.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/syslog/syslog_rpmsg.c b/drivers/syslog/syslog_rpmsg.c index 39a51f37f17..c50161e8778 100644 --- a/drivers/syslog/syslog_rpmsg.c +++ b/drivers/syslog/syslog_rpmsg.c @@ -124,16 +124,14 @@ static void syslog_rpmsg_init_buffer(FAR struct syslog_rpmsg_s *priv) DEBUGASSERT(priv->header != NULL); flags = spin_lock_irqsave(&priv->lock); +#if CONFIG_SYSLOG_RPMSG_BUFSIZE > 0 + header->size = CONFIG_SYSLOG_RPMSG_BUFSIZE - + sizeof(struct syslog_rpmsg_buffer_header_s); +#endif if (header->magic != SYSLOG_RPMSG_MAGIC_NUMBER) { header->head = 0; header->tail = 0; - -#if CONFIG_SYSLOG_RPMSG_BUFSIZE > 0 - header->size = CONFIG_SYSLOG_RPMSG_BUFSIZE - - sizeof(struct syslog_rpmsg_buffer_header_s); -#endif - header->magic = SYSLOG_RPMSG_MAGIC_NUMBER; }
