mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-29 18:28:24 +02:00
mqtt: Fix missing MQTT_API_UNLOCK in esp_mqtt_client_stop error path
Fixes: 5e17dcaeb2
("MQTT: Fix esp_mqtt_client_stop deadlock")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
@ -1494,6 +1494,7 @@ esp_err_t esp_mqtt_client_stop(esp_mqtt_client_handle_t client)
|
||||
/* A running client cannot be stopped from the MQTT task/event handler */
|
||||
TaskHandle_t running_task = xTaskGetCurrentTaskHandle();
|
||||
if (running_task == client->task_handle) {
|
||||
MQTT_API_UNLOCK(client);
|
||||
ESP_LOGE(TAG, "Client cannot be stopped from MQTT task");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user