From 942f939848a43f3822f7829016c1edede488e8e9 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 25 Jun 2018 14:34:45 -0700 Subject: [PATCH] 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 --- htc/htc_send.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htc/htc_send.c b/htc/htc_send.c index c58b37c10995..f10b1c9073a9 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -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); }