diff mbox series

[2/2] printk: nbcon: check uart port is nbcon or not in nbcon_release

Message ID 20240123054033.183114-3-junxiao.chang@intel.com
State New
Headers show
Series nbcon locking issue with v6.6.10-rt18 kernel | expand

Commit Message

Junxiao Chang Jan. 23, 2024, 5:40 a.m. UTC
Try to release nbcon only if current uart port is nbcon, as it does
in nbcon_acquire.

Signed-off-by: Junxiao Chang <junxiao.chang@intel.com>
---
 kernel/printk/nbcon.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index b53d93585ee71..d8c6f30adde8b 100644
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -1623,6 +1623,9 @@  void nbcon_release(struct uart_port *up)
 		.prio		= NBCON_PRIO_NORMAL,
 	};
 
+	if (!uart_is_nbcon(up))
+		return;
+
 	if (!up->nbcon_locked_port)
 		return;