net/ethernet: update all iob information in the iob_update_pktlen

Update io_len to 0 when pktlen is 0. otherwise, io_pktlen and io_len will be inconsistent, cause free check failure.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
This commit is contained in:
gaohedong 2025-03-17 23:20:06 +08:00 committed by Xiang Xiao
parent ca7c6e2a6f
commit a5a29bdbbb

View file

@ -138,7 +138,7 @@ int iob_update_pktlen(FAR struct iob_s *iob, unsigned int pktlen,
/* Update size of each iob */
next = iob;
while (next != NULL && pktlen > 0)
while (next != NULL && pktlen >= 0)
{
if (pktlen + next->io_offset > IOB_BUFSIZE(next))
{