This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new eee0d813a24 can: ctucanfd: initialize CAN message header on receive
eee0d813a24 is described below
commit eee0d813a2409d817f03f00aaec919cd4cc9c18c
Author: zhaohaiyang1 <[email protected]>
AuthorDate: Tue Jan 6 19:16:35 2026 +0800
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 <[email protected]>
---
drivers/can/ctucanfd_pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/can/ctucanfd_pci.c b/drivers/can/ctucanfd_pci.c
index d512cf4c1b2..d0962cb7bbf 100644
--- a/drivers/can/ctucanfd_pci.c
+++ b/drivers/can/ctucanfd_pci.c
@@ -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);