From 68c9a492ac1b62cd2c8f632b98853df8ee76f194 Mon Sep 17 00:00:00 2001 From: Jin Cheng Date: Tue, 20 Jun 2023 20:04:57 +0800 Subject: [PATCH 1/2] Fixed the issue of alarm leak in A2DP --- components/bt/host/bluedroid/bta/av/bta_av_act.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/bt/host/bluedroid/bta/av/bta_av_act.c b/components/bt/host/bluedroid/bta/av/bta_av_act.c index f7f3dc3fc0..13a5750713 100644 --- a/components/bt/host/bluedroid/bta/av/bta_av_act.c +++ b/components/bt/host/bluedroid/bta/av/bta_av_act.c @@ -1861,8 +1861,8 @@ void bta_av_dereg_comp(tBTA_AV_DATA *p_data) bta_sys_remove_uuid(UUID_SERVCLASS_VIDEO_SOURCE); } - /* make sure that the timer is not active */ - bta_sys_stop_timer(&p_scb->timer); + /* free the delay timer for AVRC CT */ + bta_sys_free_timer(&p_scb->timer); list_free(p_scb->a2d_list); p_scb->a2d_list = NULL; utl_freebuf((void **)&p_cb->p_scb[p_scb->hdi]); From ec8a34628f1aac27011f8f3ba946b66b84a2d75e Mon Sep 17 00:00:00 2001 From: Jin Cheng Date: Wed, 21 Jun 2023 15:15:41 +0800 Subject: [PATCH 2/2] Fixed the issue of alarm leak in hf-ag --- components/bt/host/bluedroid/bta/hf_ag/bta_ag_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/bt/host/bluedroid/bta/hf_ag/bta_ag_main.c b/components/bt/host/bluedroid/bta/hf_ag/bta_ag_main.c index 77eaf0fcab..e3a505ddfd 100644 --- a/components/bt/host/bluedroid/bta/hf_ag/bta_ag_main.c +++ b/components/bt/host/bluedroid/bta/hf_ag/bta_ag_main.c @@ -461,11 +461,11 @@ void bta_ag_scb_dealloc(tBTA_AG_SCB *p_scb) APPL_TRACE_DEBUG("bta_ag_scb_dealloc %d", bta_ag_scb_to_idx(p_scb)); /* stop timers */ - bta_sys_stop_timer(&p_scb->act_timer); + bta_sys_free_timer(&p_scb->act_timer); #if (BTM_WBS_INCLUDED == TRUE) - bta_sys_stop_timer(&p_scb->cn_timer); + bta_sys_free_timer(&p_scb->cn_timer); #endif - bta_sys_stop_timer(&p_scb->colli_timer); + bta_sys_free_timer(&p_scb->colli_timer); /* initialize control block */ memset(p_scb, 0, sizeof(tBTA_AG_SCB));