Skip to content

Commit a5a29bd

Browse files
HedongGaoxiaoxiang781216
authored andcommitted
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 <[email protected]>
1 parent ca7c6e2 commit a5a29bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/iob/iob_update_pktlen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int iob_update_pktlen(FAR struct iob_s *iob, unsigned int pktlen,
138138
/* Update size of each iob */
139139

140140
next = iob;
141-
while (next != NULL && pktlen > 0)
141+
while (next != NULL && pktlen >= 0)
142142
{
143143
if (pktlen + next->io_offset > IOB_BUFSIZE(next))
144144
{

0 commit comments

Comments
 (0)