提交 a000bafa 编写于 作者: S Shubhrajyoti Datta 提交者: Greg Kroah-Hartman

tty: xilinx_uartps: Check the clk_enable return value

Check the clk_enable return value.
If clocks are not enabled the register accesses could hang the
system so error out instead.
Signed-off-by: NShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/20220729114748.18332-8-shubhrajyoti.datta@xilinx.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a17fa121
......@@ -1420,9 +1420,17 @@ static int __maybe_unused cdns_runtime_resume(struct device *dev)
{
struct uart_port *port = dev_get_drvdata(dev);
struct cdns_uart *cdns_uart = port->private_data;
int ret;
ret = clk_enable(cdns_uart->pclk);
if (ret)
return ret;
clk_enable(cdns_uart->pclk);
clk_enable(cdns_uart->uartclk);
ret = clk_enable(cdns_uart->uartclk);
if (ret) {
clk_disable(cdns_uart->pclk);
return ret;
}
return 0;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册