[smart] fixup rt_hw_serial_unregister_tty of serial tty

Mutex lock should be taken before release the TTY device.

Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
Shell 2024-04-19 10:59:21 +08:00 committed by Meco Man
parent 57d157b8ab
commit 732d32be09
1 changed files with 2 additions and 0 deletions

View File

@ -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? */