correctly set the tailq ptr when removing the last item in the q

Approved by:	re (kensmith)
This commit is contained in:
Sam Leffler 2009-07-10 02:19:57 +00:00
parent 5c663ce9cf
commit f6c09dd6a8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195527

View File

@ -211,7 +211,6 @@ ieee80211_ageq_remove(struct ieee80211_ageq *aq,
/*
* Remove from forward list; tail pointer is harder.
*/
*prev = m->m_nextpkt;
if (aq->aq_tail == m) {
KASSERT(m->m_nextpkt == NULL, ("not last"));
if (aq->aq_head == m) { /* list empty */
@ -223,6 +222,8 @@ ieee80211_ageq_remove(struct ieee80211_ageq *aq,
offsetof(struct mbuf, m_nextpkt));
}
}
*prev = m->m_nextpkt;
/* add to private list for return */
*phead = m;
phead = &m->m_nextpkt;