From e71aeae1bdd35da24f1c32a1013e0942d41e58e5 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Wed, 19 Feb 2020 18:05:22 +0530 Subject: [PATCH] qcacmn: Set FIXUP_NBUF flag only on successful nbuf map In the scenario where nbuf_map fails during packet send in htc_issue_packets, restore_tx_packet done as part of cleanup, does nbuf unmap even though map failed. Fix is to set the fixup_netbuf flag only if nbuf map is successful. Change-Id: I642eff15792a7e374434e5a7a05ad546af376b3a CRs-Fixed: 2625765 --- htc/htc_send.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htc/htc_send.c b/htc/htc_send.c index 3e47f03e48..4e79ec0ade 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -795,9 +795,6 @@ static QDF_STATUS htc_issue_packets(HTC_TARGET *target, * frames, since data frames were already mapped as they * entered into the driver. */ - pPacket->PktInfo.AsTx.Flags |= - HTC_TX_PACKET_FLAG_FIXUP_NETBUF; - ret = qdf_nbuf_map(target->osdev, GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket), QDF_DMA_TO_DEVICE); @@ -809,6 +806,8 @@ static QDF_STATUS htc_issue_packets(HTC_TARGET *target, status = QDF_STATUS_E_FAILURE; break; } + pPacket->PktInfo.AsTx.Flags |= + HTC_TX_PACKET_FLAG_FIXUP_NETBUF; } if (!pEndpoint->async_update) {