Kaynağa Gözat

qcacmn: Fix memleaks in Rx refill buffer pool

Rx refill lock is not in sync during deinit path causing
mem leak of refill buffers. Set the Rx refill lock during deinit path.

Change-Id: Ic7d07c0fcaae26f6a269afcba4d593be1d5eacad
CRs-Fixed: 2898006
Karthik Kantamneni 4 yıl önce
ebeveyn
işleme
ca0a3ae0ac
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 8 0
      dp/wifi3.0/dp_rx_buffer_pool.c

+ 8 - 0
dp/wifi3.0/dp_rx_buffer_pool.c

@@ -373,10 +373,12 @@ static void dp_rx_refill_buff_pool_deinit(struct dp_soc *soc, u8 mac_id)
 	struct rx_refill_buff_pool *buff_pool = &soc->rx_refill_buff_pool;
 	struct rx_desc_pool *rx_desc_pool = &soc->rx_desc_buf[mac_id];
 	qdf_nbuf_t nbuf;
+	uint32_t count = 0;
 
 	if (!buff_pool->is_initialized)
 		return;
 
+	buff_pool->in_rx_refill_lock  = true;
 	while ((nbuf = dp_rx_refill_buff_pool_dequeue_nbuf(soc))) {
 		dp_ipa_handle_rx_buf_smmu_mapping(soc, nbuf,
 						  rx_desc_pool->buf_size,
@@ -385,8 +387,14 @@ static void dp_rx_refill_buff_pool_deinit(struct dp_soc *soc, u8 mac_id)
 					     QDF_DMA_BIDIRECTIONAL,
 					     rx_desc_pool->buf_size);
 		qdf_nbuf_free(nbuf);
+		count++;
 	}
+	buff_pool->in_rx_refill_lock  = false;
 
+	dp_info("Rx refill buffers freed during deinit %u qlen: %u",
+		count, buff_pool->bufq_len);
+
+	qdf_spinlock_destroy(&buff_pool->bufq_lock);
 	buff_pool->is_initialized = false;
 }