qcacmn: Flush TxLookupQueue for WMI_CONTROL_SVC during htc_stop
TX comletion for WMI_FORCE_FW_HANG_CMDID would come after
TARGET_STATUS_RESET is set. In such a senario, there would
be memory leak.
Flush TxLookupQueue for WMI_CONTROL_SVC during htc_stop.
Since netbuf is freed in ISR, just free HTC frame here.
Change-Id: I5fab3effda1db70fa9b1208c854231a88b48309b
CRs-Fixed: 2242862
diff --git a/htc/htc_send.c b/htc/htc_send.c
index f10b1c9..336a511 100644
--- a/htc/htc_send.c
+++ b/htc/htc_send.c
@@ -2064,7 +2064,8 @@
/* flush pending entries in endpoint TX Lookup queue */
void htc_flush_endpoint_txlookupQ(HTC_TARGET *target,
- HTC_ENDPOINT_ID endpoint_id)
+ HTC_ENDPOINT_ID endpoint_id,
+ bool call_ep_callback)
{
HTC_PACKET *packet;
HTC_ENDPOINT *endpoint;
@@ -2078,8 +2079,12 @@
packet = htc_packet_dequeue(&endpoint->TxLookupQueue);
if (packet) {
- packet->Status = QDF_STATUS_E_CANCELED;
- send_packet_completion(target, packet);
+ if (call_ep_callback == true) {
+ packet->Status = QDF_STATUS_E_CANCELED;
+ send_packet_completion(target, packet);
+ } else {
+ qdf_mem_free(packet);
+ }
}
}
}