Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Zhaoyang Yu and committed by
Greg Kroah-Hartman
2c8c3487 c1d2deb6

+2 -1
+2 -1
drivers/tty/serial/mxs-auart.c
··· 1318 1318 s = auart_port[co->index]; 1319 1319 port = &s->port; 1320 1320 1321 - clk_enable(s->clk); 1321 + if (clk_enable(s->clk)) 1322 + return; 1322 1323 1323 1324 /* First save the CR then disable the interrupts */ 1324 1325 old_ctrl2 = mxs_read(s, REG_CTRL2);