Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: owl: Fix missing clk_disable_unprepare() in owl_uart_probe

Fix the missing clk_disable_unprepare() before return
from owl_uart_probe() in the error handling case.

Fixes: abf42d2f333b ("tty: serial: owl: add "much needed" clk_prepare_enable()")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220307105135.11698-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Miaoqian Lin and committed by
Greg Kroah-Hartman
bcea0f54 e73b5c7f

+1
+1
drivers/tty/serial/owl-uart.c
··· 731 731 owl_port->port.uartclk = clk_get_rate(owl_port->clk); 732 732 if (owl_port->port.uartclk == 0) { 733 733 dev_err(&pdev->dev, "clock rate is zero\n"); 734 + clk_disable_unprepare(owl_port->clk); 734 735 return -EINVAL; 735 736 } 736 737 owl_port->port.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_LOW_LATENCY;