summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/net/iob/iob_trimhead.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/nuttx/net/iob/iob_trimhead.c b/nuttx/net/iob/iob_trimhead.c
index bb3997c69..ffb1bc8b7 100644
--- a/nuttx/net/iob/iob_trimhead.c
+++ b/nuttx/net/iob/iob_trimhead.c
@@ -112,21 +112,21 @@ FAR struct iob_s *iob_trimhead(FAR struct iob_s *iob, unsigned int trimlen)
* data size.
*/
- pktlen -= iob->io_len;
- trimlen -= iob->io_len;
- iob->io_len = 0;
- iob->io_offset = 0;
+ pktlen -= iob->io_len;
+ trimlen -= iob->io_len;
/* Check if this was the last entry in the chain */
next = iob->io_flink;
- if (!next)
+ if (next == NULL)
{
/* Yes.. break out of the loop returning the empty
* I/O buffer chain containing only one empty entry.
*/
DEBUGASSERT(pktlen == 0);
+ iob->io_len = 0;
+ iob->io_offset = 0;
break;
}