Skip to content

Commit 6b45617

Browse files
haitomaticxiaoxiang781216
authored andcommitted
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 <hai.to@unikie.com>
1 parent 12cee02 commit 6b45617

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

arch/risc-v/src/mpfs/mpfs_can.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -731,16 +731,6 @@ static int mpfs_transmit(struct netdev_lowerhalf_s *dev,
731731
return -EINVAL;
732732
}
733733

734-
/* Validate packet size first, like reference driver */
735-
736-
if (netpkt_getdatalen(dev, pkt) != sizeof(struct can_frame))
737-
{
738-
nerr("Invalid packet size: %u bytes (expected %zu)\n",
739-
netpkt_getdatalen(dev, pkt), sizeof(struct can_frame));
740-
netpkt_free(dev, pkt, NETPKT_TX);
741-
return -EINVAL;
742-
}
743-
744734
/* Get direct pointer to CAN frame data */
745735

746736
struct can_frame *frame =

0 commit comments

Comments
 (0)