diff options
| author | Shell <[email protected]> | 2024-04-19 10:59:21 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2024-04-20 11:35:45 -0400 |
| commit | 732d32be09e2a9bbe6e648e31482eedb0c0c10b7 (patch) | |
| tree | 131417f68b7d5db480786123da8e441f7c776c61 | |
| parent | 57d157b8ab8718de1230d071f96af8400195af64 (diff) | |
[smart] fixup rt_hw_serial_unregister_tty of serial tty
Mutex lock should be taken before release the TTY device.
Signed-off-by: Shell <[email protected]>
| -rw-r--r-- | components/drivers/serial/serial_tty.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/components/drivers/serial/serial_tty.c b/components/drivers/serial/serial_tty.c index 1443cd1632..a4c3dbbe41 100644 --- a/components/drivers/serial/serial_tty.c +++ b/components/drivers/serial/serial_tty.c @@ -358,6 +358,8 @@ rt_err_t rt_hw_serial_unregister_tty(struct rt_serial_device *serial) softc = tty_softc(tp); serial->rx_notify = softc->backup_notify; + tty_lock(tp); + tty_rel_gone(tp); /* device unregister? */ |
