You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2023/01/31 05:20:17 UTC

[GitHub] [nuttx] anchao commented on a diff in pull request #8361: net/devif: check the net device before use

anchao commented on code in PR #8361:
URL: https://github.com/apache/nuttx/pull/8361#discussion_r1091462986


##########
net/devif/devif_iobsend.c:
##########
@@ -56,67 +57,53 @@ void devif_iob_send(FAR struct net_driver_s *dev, FAR struct iob_s *iob,
                     unsigned int len, unsigned int offset,
                     unsigned int target_offset)
 {
-#ifndef CONFIG_NET_IPFRAG
-  unsigned int limit = NETDEV_PKTSIZE(dev) -
-                       NET_LL_HDRLEN(dev) - target_offset;
+  int ret;
 
-  if (dev == NULL || len == 0 || len > limit)
-#else
   if (dev == NULL || len == 0)
-#endif
     {
-      if (dev->d_iob == NULL)
-        {
-          iob_free_chain(iob);
-        }
+      ret = -EINVAL;

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org