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.
This commit is contained in:
Rahul Tank
2021-07-08 09:58:07 +05:30
parent a90d8e46b8
commit aef55bbf63
+2 -2
View File
@@ -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);