mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 02:19:54 -04:00
tty: xilinx_uartps: Check clk_enable return value
If clocks are not enabled the register access may hang the system. Check for the clock enable return value and bail out if not enabled. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Link: https://lore.kernel.org/r/20220729114748.18332-2-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
568035b01c
commit
957e8c047b
@@ -1329,12 +1329,20 @@ static int cdns_uart_resume(struct device *device)
|
||||
unsigned long flags;
|
||||
u32 ctrl_reg;
|
||||
int may_wake;
|
||||
int ret;
|
||||
|
||||
may_wake = device_may_wakeup(device);
|
||||
|
||||
if (console_suspend_enabled && uart_console(port) && !may_wake) {
|
||||
clk_enable(cdns_uart->pclk);
|
||||
clk_enable(cdns_uart->uartclk);
|
||||
ret = clk_enable(cdns_uart->pclk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = clk_enable(cdns_uart->uartclk);
|
||||
if (ret) {
|
||||
clk_disable(cdns_uart->pclk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user