sge_encap() can sometimes return an error with m_head set to NULL.

Make sure not to requeue freed mbuf in sge_start_locked(). This
should fix NULL pointer dereference panic.

Reported by:	Nikolay Denev <ndenev <> gmail dot com>
Submitted by:	jhb
This commit is contained in:
Pyun YongHyeon 2010-05-24 17:12:44 +00:00
parent f09ee54ae0
commit 2eae4d808a

View File

@ -1588,7 +1588,8 @@ sge_start_locked(struct ifnet *ifp)
if (m_head == NULL)
break;
if (sge_encap(sc, &m_head)) {
IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
if (m_head != NULL)
IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
break;
}