projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
17be181
)
drivers:tty: fix return value check in asc_init_port
author
Yuanjun Gong
<ruc_gongyuanjun@163.com>
Mon, 17 Jul 2023 14:47:33 +0000
(22:47 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sun, 30 Jul 2023 11:53:19 +0000
(13:53 +0200)
in asc_init_port, clk_prepare_enable may fail, therefore, the
return value of clk_prepare_enable should be checked.
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
Link:
https://lore.kernel.org/r/20230717144733.24194-1-ruc_gongyuanjun@163.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/st-asc.c
patch
|
blob
|
history
diff --git
a/drivers/tty/serial/st-asc.c
b/drivers/tty/serial/st-asc.c
index
b8954f0
..
92b9f68
100644
(file)
--- a/
drivers/tty/serial/st-asc.c
+++ b/
drivers/tty/serial/st-asc.c
@@
-703,7
+703,9
@@
static int asc_init_port(struct asc_port *ascport,
if (WARN_ON(IS_ERR(ascport->clk)))
return -EINVAL;
/* ensure that clk rate is correct by enabling the clk */
- clk_prepare_enable(ascport->clk);
+ ret = clk_prepare_enable(ascport->clk);
+ if (ret)
+ return ret;
ascport->port.uartclk = clk_get_rate(ascport->clk);
WARN_ON(ascport->port.uartclk == 0);
clk_disable_unprepare(ascport->clk);