From 54e5e440b1b80f44731609c721e453b41f852030 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 4 Mar 2019 11:13:52 +0100 Subject: [PATCH] mdns: fix possible deadlock on mdns deinit calling mdns_free() mnds_free() initiates stop and delete timer tasks, which after locking the mutex could lead to a dead lock in case timer task executed before deleting the task, as it would wait indefinitelly for unlocking the mutex. This condition is fixed by calling _mdns_stop_timer without locking the mutex, because there's no need to protect any data when stopping and deleting the timer task Closes https://github.com/espressif/esp-idf/issues/1696 --- components/mdns/mdns.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index de66d9432..378816ba7 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -4038,9 +4038,7 @@ static esp_err_t _mdns_service_task_start() */ static esp_err_t _mdns_service_task_stop() { - MDNS_SERVICE_LOCK(); _mdns_stop_timer(); - MDNS_SERVICE_UNLOCK(); if (_mdns_service_task_handle) { mdns_action_t action; mdns_action_t * a = &action;