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 6b456170648 arch/risc-v/mpfs: Remove strict CAN frame data length 
check.
6b456170648 is described below

commit 6b4561706489e78332afd5d9113d0dffb15e7c6d
Author: haitomatic <[email protected]>
AuthorDate: Mon Nov 10 12:29:35 2025 +0000

    arch/risc-v/mpfs: Remove strict CAN frame data length check.
    
    In MSS CAN transmit function, the check of net pkt data len is not 
neccessary. Since there are cases that the pkt len can exceed the expected 16 
bytes of can_frame but the pkt is still valid. Such a case is when 
CONFIG_NET_CAN_RAW_TX_DEADLINE is enabled which has pkt len to become 32 bytes 
due to cmsghdr overhead.
    
    Signed-off-by: haitomatic <[email protected]>
---
 arch/risc-v/src/mpfs/mpfs_can.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/arch/risc-v/src/mpfs/mpfs_can.c b/arch/risc-v/src/mpfs/mpfs_can.c
index 7a113c3ed3b..6fe59130275 100644
--- a/arch/risc-v/src/mpfs/mpfs_can.c
+++ b/arch/risc-v/src/mpfs/mpfs_can.c
@@ -731,16 +731,6 @@ static int mpfs_transmit(struct netdev_lowerhalf_s *dev,
       return -EINVAL;
     }
 
-  /* Validate packet size first, like reference driver */
-
-  if (netpkt_getdatalen(dev, pkt) != sizeof(struct can_frame))
-    {
-      nerr("Invalid packet size: %u bytes (expected %zu)\n",
-           netpkt_getdatalen(dev, pkt), sizeof(struct can_frame));
-      netpkt_free(dev, pkt, NETPKT_TX);
-      return -EINVAL;
-    }
-
   /* Get direct pointer to CAN frame data */
 
   struct can_frame *frame =

Reply via email to