tcp: skip sackhole checks on NULL

Inadvertedly introduced NULL pointer dereference during
sackhole sanity check in D35387.

Reviewed By:	glebius
PR:		263445
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D35423
This commit is contained in:
Richard Scheffenegger 2022-06-07 18:16:54 +02:00
parent 92fc5822a8
commit 231e0dd5d1

View file

@ -956,7 +956,9 @@ tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt)
INP_WLOCK_ASSERT(tp->t_inpcb);
*sack_bytes_rexmt = tp->sackhint.sack_bytes_rexmit;
hole = tp->sackhint.nexthole;
if (hole == NULL || SEQ_LT(hole->rxmit, hole->end))
if (hole == NULL)
return (hole);
if (SEQ_LT(hole->rxmit, hole->end))
goto out;
while ((hole = TAILQ_NEXT(hole, scblink)) != NULL) {
if (SEQ_LT(hole->rxmit, hole->end)) {