lkml.org 
[lkml]   [2024]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] printk: nbcon: check uart port is nbcon or not in nbcon_release
Date
Different uart ports might have same console pointer, not all of
uart ports are nbcon. When uart port is shutdown, only release
nbcon if it is nbcon. There is same nbcon checking in API
nbcon_acquire.

Fixes: 6424f396c49e ("printk: nbcon: Implement processing in port->lock wrapper")
Signed-off-by: Junxiao Chang <junxiao.chang@intel.com>
---
kernel/printk/nbcon.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index 1b1b585b1675b..e53b8bebbb57e 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 (!con->locked_port)
return;

--
2.34.1

\
 
 \ /
  Last update: 2024-01-17 07:54    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog