qcacmn: Unmap DMA region mapped for nbuf in rx_desc

In attach and replenish path, nbuf maps a DMA region for device access.
But the DMA region mapped is not unmapped in detach path.

Fix is to unmap the DMA region when rx_desc_pool is freed.

Change-Id: If3e93113e59c7eec4419cb1d9228ee95c5b74b39
CRs-Fixed: 2149014
This commit is contained in:
jiad 2017-11-25 17:32:36 +08:00 • committed by snandini
commit 78e34459fd

View file

@ -80,8 +80,12 @@ void dp_rx_desc_pool_free(struct dp_soc *soc, uint32_t pool_id,
qdf_spin_lock_bh(&soc->rx_desc_mutex[pool_id]);
for (i = 0; i < rx_desc_pool->pool_size; i++) {
if (rx_desc_pool->array[i].rx_desc.in_use)
if (rx_desc_pool->array[i].rx_desc.in_use) {
qdf_nbuf_unmap_single(soc->osdev,
rx_desc_pool->array[i].rx_desc.nbuf,
QDF_DMA_BIDIRECTIONAL);
qdf_nbuf_free(rx_desc_pool->array[i].rx_desc.nbuf);
}
}
qdf_mem_free(rx_desc_pool->array);
qdf_spin_unlock_bh(&soc->rx_desc_mutex[pool_id]);