mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
Merge "qcacld-3.0: Fix an htt memory leak" into wlan-cld3.driver.lnx.2.0-dev
This commit is contained in:
commit
1258571d9e
3 changed files with 33 additions and 0 deletions
|
|
@ -118,6 +118,34 @@ void htt_htc_pkt_pool_free(struct htt_pdev_t *pdev)
|
|||
}
|
||||
|
||||
#ifdef ATH_11AC_TXCOMPACT
|
||||
|
||||
void
|
||||
htt_htc_misc_pkt_list_trim(struct htt_pdev_t *pdev, int level)
|
||||
{
|
||||
struct htt_htc_pkt_union *pkt, *next, *prev = NULL;
|
||||
int i = 0;
|
||||
qdf_nbuf_t netbuf;
|
||||
|
||||
HTT_TX_MUTEX_ACQUIRE(&pdev->htt_tx_mutex);
|
||||
pkt = pdev->htt_htc_pkt_misclist;
|
||||
while (pkt) {
|
||||
next = pkt->u.next;
|
||||
/* trim the out grown list*/
|
||||
if (++i > level) {
|
||||
netbuf = (qdf_nbuf_t)(pkt->u.pkt.htc_pkt.pNetBufContext);
|
||||
qdf_nbuf_unmap(pdev->osdev, netbuf, QDF_DMA_TO_DEVICE);
|
||||
qdf_nbuf_free(netbuf);
|
||||
qdf_mem_free(pkt);
|
||||
pkt = NULL;
|
||||
if (prev)
|
||||
prev->u.next = NULL;
|
||||
}
|
||||
prev = pkt;
|
||||
pkt = next;
|
||||
}
|
||||
HTT_TX_MUTEX_RELEASE(&pdev->htt_tx_mutex);
|
||||
}
|
||||
|
||||
void htt_htc_misc_pkt_list_add(struct htt_pdev_t *pdev, struct htt_htc_pkt *pkt)
|
||||
{
|
||||
struct htt_htc_pkt_union *u_pkt = (struct htt_htc_pkt_union *)pkt;
|
||||
|
|
@ -130,6 +158,8 @@ void htt_htc_misc_pkt_list_add(struct htt_pdev_t *pdev, struct htt_htc_pkt *pkt)
|
|||
pdev->htt_htc_pkt_misclist = u_pkt;
|
||||
}
|
||||
HTT_TX_MUTEX_RELEASE(&pdev->htt_tx_mutex);
|
||||
|
||||
htt_htc_misc_pkt_list_trim(pdev, HTT_HTC_PKT_MISCLIST_SIZE);
|
||||
}
|
||||
|
||||
void htt_htc_misc_pkt_pool_free(struct htt_pdev_t *pdev)
|
||||
|
|
|
|||
|
|
@ -506,6 +506,8 @@ void htt_htc_pkt_free(struct htt_pdev_t *pdev, struct htt_htc_pkt *pkt);
|
|||
void htt_htc_pkt_pool_free(struct htt_pdev_t *pdev);
|
||||
|
||||
#ifdef ATH_11AC_TXCOMPACT
|
||||
void htt_htc_misc_pkt_list_trim(struct htt_pdev_t *pdev, int level);
|
||||
|
||||
void
|
||||
htt_htc_misc_pkt_list_add(struct htt_pdev_t *pdev, struct htt_htc_pkt *pkt);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
#endif
|
||||
#endif /* QCA_TX_HTT2_SUPPORT */
|
||||
|
||||
#define HTT_HTC_PKT_MISCLIST_SIZE 32
|
||||
|
||||
struct htt_htc_pkt {
|
||||
void *pdev_ctxt;
|
||||
|
|
|
|||
Loading…
Reference in a new issue