qcacmn: Conditionally unmap nbuf in htc_issue_packets

htc_issue_packets currently unmaps all nbufs during error handling.
However, htc_issue_packets only maps nbufs under some situations. Make
the criteria for unmapping match the criteria for mapping.

Change-Id: Ia77cffb30edbdb4d1378af38368f860c6f8c0b18
CRs-Fixed: 2266437
This commit is contained in:
Dustin Brown
2018-06-25 14:34:45 -07:00
committed by nshrivas
parent 3bdf380c03
commit 942f939848

View File

@@ -633,9 +633,13 @@ static QDF_STATUS htc_issue_packets(HTC_TARGET *target,
("hif_send Failed status:%d\n",
status));
}
qdf_nbuf_unmap(target->osdev,
GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket),
QDF_DMA_TO_DEVICE);
/* only unmap if we mapped in this function */
if (IS_TX_CREDIT_FLOW_ENABLED(pEndpoint))
qdf_nbuf_unmap(target->osdev,
GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket),
QDF_DMA_TO_DEVICE);
if (!pEndpoint->async_update) {
LOCK_HTC_TX(target);
}