mirror of
https://github.com/apache/nuttx.git
synced 2025-12-09 03:33:51 +08:00
arch/risc-v/mpfs: Remove strict CAN frame data length check.
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Some checks failed
Build Documentation / build-html (push) Has been cancelled
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>
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user