mirror of
https://github.com/apache/nuttx.git
synced 2026-09-22 06:04:28 +08:00
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:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user