]> granicus.if.org Git - esp-idf/commitdiff
component/bt: Remove the p_tle->param reset to 0 when free the p_timer_param pointer.
authoryulong <huangyulong@espressif.com>
Thu, 30 Nov 2017 08:15:22 +0000 (16:15 +0800)
committeryulong <huangyulong@espressif.com>
Thu, 30 Nov 2017 08:15:22 +0000 (16:15 +0800)
components/bt/bluedroid/bta/gatt/bta_gattc_act.c

index cc3e08494dbd366d1518ccdf818c205ca7c39188..3196ffb678d13747123c7deaa6bc2573498fd5d8 100644 (file)
@@ -2358,6 +2358,7 @@ static void bta_gattc_wait4_service_change_ccc_cback (TIMER_LIST_ENT *p_tle)
     osi_mutex_lock(&write_ccc_mutex, OSI_MUTEX_MAX_TIMEOUT);
 
     tBTA_GATTC_WAIT_CCC_TIMER *p_timer_param = (tBTA_GATTC_WAIT_CCC_TIMER*) p_tle->param;
+    p_tle->param = (TIMER_PARAM_TYPE)0;
     if (p_timer_param == NULL){
         APPL_TRACE_ERROR("p_timer_param is NULL in %s\n", __func__);
         return;
@@ -2367,7 +2368,6 @@ static void bta_gattc_wait4_service_change_ccc_cback (TIMER_LIST_ENT *p_tle)
     if (p_conn == NULL){
         APPL_TRACE_ERROR("p_conn is NULL in %s\n", __func__);
         osi_free(p_timer_param);
-        p_tle->param = (TIMER_PARAM_TYPE)0;
         return;
     }
 
@@ -2399,7 +2399,6 @@ static void bta_gattc_wait4_service_change_ccc_cback (TIMER_LIST_ENT *p_tle)
     }
 
     osi_free(p_timer_param);
-    p_tle->param = (TIMER_PARAM_TYPE)0;
     osi_mutex_unlock(&write_ccc_mutex);
 }