mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00: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:
parent
ca7c6e2a6f
commit
a5a29bdbbb
1 changed files with 1 additions and 1 deletions
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue