From 587c11d1d35d2970a8a1b6a10080e5ea63c9a107 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Fri, 8 Nov 2024 22:37:26 +0100 Subject: [PATCH] Fix FlipTDI crashing on Linux when connecting to a Linux system --- flip_tdi/helpers/ftdi_usb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flip_tdi/helpers/ftdi_usb.c b/flip_tdi/helpers/ftdi_usb.c index fdb5a4cf..035d689a 100644 --- a/flip_tdi/helpers/ftdi_usb.c +++ b/flip_tdi/helpers/ftdi_usb.c @@ -138,6 +138,8 @@ static FtdiUsb* ftdi_cur = NULL; static void ftdi_usb_callback_tx_immediate(void* context) { FtdiUsb* ftdi_usb = context; + if (!ftdi_usb || !ftdi_usb->thread) return; + furi_thread_flags_set(furi_thread_get_id(ftdi_usb->thread), EventTxImmediate); } @@ -186,6 +188,7 @@ static void ftdi_usb_deinit(usbd_device* dev) { free(ftdi_usb->usb.str_serial_descr); ftdi_usb->usb.str_serial_descr = NULL; free(ftdi_usb); + ftdi_usb = NULL; } static void ftdi_usb_send(usbd_device* dev, uint8_t* buf, uint16_t len) {