Kaynağa Gözat

qcacld-3.0: Fix nbuf double free for TSO packets

Nbuf users count is not updated properly during failure
case of TSO transmission this is leading to double free.

Fix is to update nbuf users count properly during failure cases.

Change-Id: I68722ec9e62157624dc8a2cd00fd479b9e9e7794
CRs-Fixed: 2759727
Karthik Kantamneni 4 yıl önce
ebeveyn
işleme
5e148e5431
1 değiştirilmiş dosya ile 6 ekleme ve 2 silme
  1. 6 2
      core/dp/txrx/ol_tx_ll_fastpath.c

+ 6 - 2
core/dp/txrx/ol_tx_ll_fastpath.c

@@ -482,7 +482,9 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
 						tso_info->curr_seg = next_seg;
 						ol_free_remaining_tso_segs(vdev,
 							&msdu_info, true);
-						if (segments)
+						if (segments ==
+						    (msdu_info.tso_info.num_segs
+						     - 1))
 							qdf_nbuf_tx_free(
 							msdu,
 							QDF_NBUF_PKT_ERROR);
@@ -515,7 +517,9 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
 				if (qdf_nbuf_is_tso(msdu)) {
 					ol_free_remaining_tso_segs(vdev,
 							&msdu_info, true);
-					qdf_nbuf_tx_free(msdu,
+					if (segments ==
+					    (msdu_info.tso_info.num_segs - 1))
+						qdf_nbuf_tx_free(msdu,
 							 QDF_NBUF_PKT_ERROR);
 				}
 				TXRX_STATS_MSDU_LIST_INCR(