summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorZhaoyang Yu <2426767509@qq.com>2026-03-01 16:22:56 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-03-12 15:24:23 +0100
commit2c8c3487b25b2e599528299224a54941e0b835ed (patch)
tree45c7d5e32d55e3b205545ef6b687dc3986d80869 /drivers/tty
parentc1d2deb6492fbd900392f4ebd47572ca4903d0fe (diff)
downloadlinux-next-2c8c3487b25b2e599528299224a54941e0b835ed.tar.gz
linux-next-2c8c3487b25b2e599528299224a54941e0b835ed.zip
serial: auart: check clk_enable() return in console write
Add a check for clk_enable() in auart_console_write(). If clk_enable() fails, return immediately to avoid accessing hardware registers while the clock is not enabled. Signed-off-by: Zhaoyang Yu <2426767509@qq.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/tencent_AB29FADF1FAD67D818283B6BB4FDF66F2F08@qq.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/mxs-auart.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index cc65c9fb6446..693b491f1e75 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -1318,7 +1318,8 @@ auart_console_write(struct console *co, const char *str, unsigned int count)
s = auart_port[co->index];
port = &s->port;
- clk_enable(s->clk);
+ if (clk_enable(s->clk))
+ return;
/* First save the CR then disable the interrupts */
old_ctrl2 = mxs_read(s, REG_CTRL2);