in_pcb: improve inp_next()

If there is no inp to check, exit the loop iterating through them.

Reported by:	syzbot+403406a9cbf082b36ea4@syzkaller.appspotmail.com
Reviewed by:	glebius
Sponsored by:	Netflix, Inc.
This commit is contained in:
Michael Tuexen 2022-01-01 18:59:47 +01:00
parent c217390359
commit 430df2abee

View file

@ -1656,6 +1656,8 @@ inp_next(struct inpcb_iterator *ii)
smr_enter(ipi->ipi_smr);
MPASS(inp != II_LIST_FIRST(ipi, hash));
inp = II_LIST_FIRST(ipi, hash);
if (inp == NULL)
break;
}
}