qcacmn: Fix potential nbuf memory leak if mmap fails

Make sure free the allocated nbuf if we fail to memory map it.

Change-Id: I90606ab088fc093b390644478bccc77f08800cd5
CRs-Fixed: 2142469
This commit is contained in:
Manjunathappa Prakash
2017-11-10 20:27:19 -08:00
committed by snandini
parent c850ec6e18
commit 6d2f46df2c

View File

@@ -170,7 +170,8 @@ QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
ret = qdf_nbuf_map_single(dp_soc->osdev, rx_netbuf,
QDF_DMA_BIDIRECTIONAL);
if (ret == QDF_STATUS_E_FAILURE) {
if (qdf_unlikely(ret == QDF_STATUS_E_FAILURE)) {
qdf_nbuf_free(rx_netbuf);
DP_STATS_INC(dp_pdev, replenish.map_err, 1);
continue;
}