diff options
author | Yi Yang <yiyang13@huawei.com> | 2023-08-17 13:54:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-22 16:29:18 +0300 |
commit | 5abd01145d0cc6cd1b7c2fe6ee0b9ea0fa13671e (patch) | |
tree | 1706a6b63e1c2899d4b9c588b71c723c439c2816 /drivers/tty | |
parent | 8a6498f2b94333f1793bc912b11830655f975470 (diff) | |
download | linux-5abd01145d0cc6cd1b7c2fe6ee0b9ea0fa13671e.tar.xz |
serial: tegra: handle clk prepare error in tegra_uart_hw_init()
In tegra_uart_hw_init(), the return value of clk_prepare_enable() should
be checked since it might fail.
Fixes: e9ea096dd225 ("serial: tegra: add serial driver")
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Link: https://lore.kernel.org/r/20230817105406.228674-1-yiyang13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/serial-tegra.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index 0b597b282fce..d4ec943cb8e9 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -996,7 +996,11 @@ static int tegra_uart_hw_init(struct tegra_uart_port *tup) tup->ier_shadow = 0; tup->current_baud = 0; - clk_prepare_enable(tup->uart_clk); + ret = clk_prepare_enable(tup->uart_clk); + if (ret) { + dev_err(tup->uport.dev, "could not enable clk\n"); + return ret; + } /* Reset the UART controller to clear all previous status.*/ reset_control_assert(tup->rst); |