Call drbr_advance() before leaving TX routine

If drbr_advance() is not called before doing cleanup and packet is
already enqueued for sending (tx_info is holding pointer to mbuf), then
mbuf is cleaned both in drbr_flush() and in cleanup routine, when all
mbufs hold by tx_buffer_info are being released.

This causes panic, because mbuf is released twice.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.
This commit is contained in:
Zbigniew Bodek 2017-07-04 00:04:31 +00:00
parent 93471047c0
commit b4b2903275
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320629

View File

@ -2805,10 +2805,11 @@ ena_start_xmit(struct ena_ring *tx_ring)
break;
}
drbr_advance(adapter->ifp, tx_ring->br);
if ((adapter->ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
drbr_advance(adapter->ifp, tx_ring->br);
acum_pkts++;
BPF_MTAP(adapter->ifp, mbuf);