From 449e905f461f75cca54b06a0c3717a5f7a7dbe35 Mon Sep 17 00:00:00 2001 From: Vadim Kaushan Date: Thu, 10 Sep 2020 22:06:39 +0300 Subject: [PATCH] Handle furi_open() error --- core/tty_uart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/tty_uart.c b/core/tty_uart.c index d687b14b4..5a2b360c7 100644 --- a/core/tty_uart.c +++ b/core/tty_uart.c @@ -13,6 +13,9 @@ static ssize_t stdout_write(void *_cookie, const char *buf, size_t n) { FuriRecordSubscriber *log = pvTaskGetThreadLocalStoragePointer(NULL, 0); if (log == NULL) { log = furi_open("tty", false, false, NULL, NULL, NULL); + if (log == NULL) { + return -1; + } vTaskSetThreadLocalStoragePointer(NULL, 0, log); } if (buf == 0) {