hyperv/hn: Hold the TX ring lock then drain TX desc buf_ring

Reported by:	Hongxiong Xian <v-hoxian microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
This commit is contained in:
Sepherosa Ziehau 2016-02-25 07:03:10 +00:00
parent a4965cf07b
commit fd458696b3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=296024

View File

@ -2326,8 +2326,10 @@ hn_destroy_tx_ring(struct hn_tx_ring *txr)
hn_txdesc_dmamap_destroy(txd);
}
#else
mtx_lock(&txr->hn_tx_lock);
while ((txd = buf_ring_dequeue_sc(txr->hn_txdesc_br)) != NULL)
hn_txdesc_dmamap_destroy(txd);
mtx_unlock(&txr->hn_tx_lock);
#endif
if (txr->hn_tx_data_dtag != NULL)