summaryrefslogtreecommitdiff
path: root/hif
diff options
context:
space:
mode:
authorTiger Yu <tfyu@codeaurora.org>2017-11-03 17:21:43 +0800
committersnandini <snandini@codeaurora.org>2017-11-11 09:25:12 -0800
commitd448fad508d437c3a7274a98e626846fda75863c (patch)
tree53010deb8f36a3e433de7026171b70e60e2bfb44 /hif
parentf2e0ad8d0fba039ab5e246f592168b36dd2c76c0 (diff)
downloadqca-wfi-host-cmn-d448fad508d437c3a7274a98e626846fda75863c.tar.gz
qcacmn: Fix memory leak for SDIO RX path in the HIF layer
qcacld-2.0 to qcacmn propagation There is a memory leak if fail to process the rx packet header in the HIF layer. Add sanity checking to free all resources if failure hit. Change-Id: Ifa443dcec0a31ae39356ac1ddf7cfe652d8968ce CRs-Fixed: 2137736
Diffstat (limited to 'hif')
-rw-r--r--hif/src/sdio/hif_sdio_recv.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hif/src/sdio/hif_sdio_recv.c b/hif/src/sdio/hif_sdio_recv.c
index 548352ad1..ae617c90c 100644
--- a/hif/src/sdio/hif_sdio_recv.c
+++ b/hif/src/sdio/hif_sdio_recv.c
@@ -1025,8 +1025,11 @@ QDF_STATUS hif_dev_recv_message_pending_handler(struct hif_sdio_device *pdev,
hif_dev_process_recv_header(pdev, packet,
look_aheads,
&num_look_aheads);
- if (QDF_IS_STATUS_ERROR(status))
+ if (QDF_IS_STATUS_ERROR(status)) {
+ HTC_PACKET_ENQUEUE_TO_HEAD(&sync_completed_pkts_queue,
+ packet);
break;
+ }
netbuf = (qdf_nbuf_t) packet->pNetBufContext;
/* set data length */
@@ -1044,8 +1047,13 @@ QDF_STATUS hif_dev_recv_message_pending_handler(struct hif_sdio_device *pdev,
pipeid);
}
}
- if (QDF_IS_STATUS_ERROR(status))
+
+ if (QDF_IS_STATUS_ERROR(status)) {
+ if (!HTC_QUEUE_EMPTY(&sync_completed_pkts_queue))
+ hif_dev_free_recv_pkt_queue(
+ &sync_completed_pkts_queue);
break;
+ }
if (num_look_aheads == 0) {
/* no more look aheads */