m_defrag(9) does not touch original mbuf chain when it can't

allocate new mbuf.  Free original mbuf chain when driver is not
able to send the packet.
This commit is contained in:
Pyun YongHyeon 2014-01-08 01:06:32 +00:00
parent 4e5422a9e6
commit 2c6d18ebc3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260429

View file

@ -1660,6 +1660,7 @@ ale_encap(struct ale_softc *sc, struct mbuf **m_head)
(mtod(m, intptr_t) & 3) != 0) {
m = m_defrag(*m_head, M_NOWAIT);
if (m == NULL) {
m_freem(*m_head);
*m_head = NULL;
return (ENOBUFS);
}