can: ctucanfd: initialize CAN message header on receive

The CAN message header was not fully initialized in
ctucanfd_chardev_receive(), which could result in uninitialized
fields and incorrect message contents being delivered to
upper-layer applications.

Signed-off-by: zhaohaiyang1 <zhaohaiyang1@xiaomi.com>
This commit is contained in:
zhaohaiyang1
2026-01-06 19:16:35 +08:00
committed by Xiang Xiao
parent 24651af90c
commit eee0d813a2
+2
View File
@@ -739,6 +739,8 @@ static void ctucanfd_chardev_receive(FAR struct ctucanfd_can_s *priv)
uint16_t frc = 0;
uint32_t regval = 0;
memset(&hdr, 0, sizeof(hdr));
/* Get frame count */
regval = ctucanfd_getreg(priv, CTUCANFD_RXSETSTAT);