From e34e0b45ded28856baac1a94c854f9a26d1f80f5 Mon Sep 17 00:00:00 2001 From: Admar Schoonen Date: Wed, 30 Sep 2020 13:56:41 +0200 Subject: [PATCH] Fixed bug where mutex would not be unlocked (#3837) Fixed bug where uartResizeRxBuffer() did not unlock mutex if creation of queue failed. --- cores/esp32/esp32-hal-uart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index 26652846..63ea03a5 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -257,6 +257,7 @@ size_t uartResizeRxBuffer(uart_t * uart, size_t new_size) { vQueueDelete(uart->queue); uart->queue = xQueueCreate(new_size, sizeof(uint8_t)); if(uart->queue == NULL) { + UART_MUTEX_UNLOCK(); return NULL; } }