From aef55bbf636ed580d4d6408a5c2e75d1f70a875e Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Wed, 7 Jul 2021 12:52:36 +0530 Subject: [PATCH] Nimble: Fix crash when attempting to do deinit If esp timer is created, but not started, and if we call Nimble deinit , then during deinit, the existing code checks for the timer state and returns with a status other than ESP_OK. However, existing ESP_ERROR_CHECK macro treats this as failure and causes crash. Modified the code to use ESP_ERROR_CHECK_WITHOUT_ABORT instead. --- porting/npl/freertos/src/npl_os_freertos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/porting/npl/freertos/src/npl_os_freertos.c b/porting/npl/freertos/src/npl_os_freertos.c index 08a1fd8e7..876cf5507 100644 --- a/porting/npl/freertos/src/npl_os_freertos.c +++ b/porting/npl/freertos/src/npl_os_freertos.c @@ -368,8 +368,8 @@ void npl_freertos_callout_deinit(struct ble_npl_callout *co) { #if CONFIG_BT_NIMBLE_USE_ESP_TIMER - ESP_ERROR_CHECK(esp_timer_stop(co->handle)); - ESP_ERROR_CHECK(esp_timer_delete(co->handle)); + ESP_ERROR_CHECK_WITHOUT_ABORT(esp_timer_stop(co->handle)); + ESP_ERROR_CHECK_WITHOUT_ABORT(esp_timer_delete(co->handle)); #else if (co->handle) { xTimerDelete(co->handle, portMAX_DELAY);