nuttx-mirror/drivers/usbdev
Jukka Laitinen 575c608be8 drivers/usbdev/cdcacm.c: Fix a crash in cdcacm if usbdev gets unregistered while client calls close for the tty
Make sure that the cdcacm is disconnected before the usbdev gets unregistered.

Also, check if the device is connected or not in cdcuart_txempty (uart_txempty). Otherwise there may be a crash during uart_tcdrain, called in tty close path, if the usbdev unregistration happens during the loop.

This issue can be triggered by monitoring the cable connection status in one thread, sending BOARDIOC_USBDEV_DISCONNECT if the usb cable is detached. In another thread close the ttyACM.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-01-10 21:14:55 +08:00
..
adb.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
cdcacm.c drivers/usbdev/cdcacm.c: Fix a crash in cdcacm if usbdev gets unregistered while client calls close for the tty 2025-01-10 21:14:55 +08:00
cdcacm.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
cdcacm_desc.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
cdcecm.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
cdcecm.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
cdcncm.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
CMakeLists.txt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
composite.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
composite.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
composite_desc.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
dfu.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
Kconfig cdcacm: config to enable or disable interrupt endpoint 2024-09-30 20:32:47 +08:00
Make.defs drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
mtp.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pl2303.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
rndis.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
rndis_std.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_desc.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_fs.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_fs.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_req.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_strings.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_trace.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbdev_trprintf.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbmsc.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbmsc.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbmsc_desc.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
usbmsc_scsi.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00