提交 6d51cd40 编写于 作者: S Shubhrajyoti Datta 提交者: Zheng Zengkai

tty: serial: uartlite: Disable clocks in case of errors

mainline inclusion
from mainline-v5.15-rc1
commit ed623dff
category: bugfix
bugzilla: 187303, https://gitee.com/openeuler/kernel/issues/I5ZXV2
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ed623dffdeebcc0acac7be6af4a301ee7169cd21

-------------------------------

In case the uart registration fails the clocks are left enabled.
Disable the clock in case of errors.
Signed-off-by: NShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/20210713064835.27978-2-shubhrajyoti.datta@xilinx.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NCai Xinchen <caixinchen1@huawei.com>
Reviewed-by: NGONG Ruiqi <gongruiqi1@huawei.com>
Reviewed-by: NWang Weiyang <wangweiyang2@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 2af37d40
...@@ -784,6 +784,7 @@ static int ulite_probe(struct platform_device *pdev) ...@@ -784,6 +784,7 @@ static int ulite_probe(struct platform_device *pdev)
ret = uart_register_driver(&ulite_uart_driver); ret = uart_register_driver(&ulite_uart_driver);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "Failed to register driver\n"); dev_err(&pdev->dev, "Failed to register driver\n");
clk_disable_unprepare(pdata->clk);
return ret; return ret;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册