Don't unlock a timewait structure if the pointer is NULL in

tcp_timewait().  This corrects a bug (or lack of fixing of a bug)
in tcp_input.c:1.295.

Submitted by:	Kazuaki Oda <kaakun at highway dot ne dot jp>
MFC after:	3 months
This commit is contained in:
Robert Watson 2006-04-05 08:45:59 +00:00
parent 50ff9670e2
commit a460ae4b4c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157534
2 changed files with 4 additions and 2 deletions

View File

@ -3272,7 +3272,8 @@ tcp_timewait(tw, to, th, m, tlen)
return (0);
drop:
INP_UNLOCK(tw->tw_inpcb);
if (tw != NULL)
INP_UNLOCK(tw->tw_inpcb);
m_freem(m);
return (0);
}

View File

@ -3272,7 +3272,8 @@ tcp_timewait(tw, to, th, m, tlen)
return (0);
drop:
INP_UNLOCK(tw->tw_inpcb);
if (tw != NULL)
INP_UNLOCK(tw->tw_inpcb);
m_freem(m);
return (0);
}