summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/pic32_uart.c
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-05-25 10:12:04 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-10 13:33:28 +0200
commit6f3cdf2bf1ba9b70de6c2921a415951a0d59873b (patch)
treea86496dff5387d49bee8a9eaf39441e9488550e2 /drivers/tty/serial/pic32_uart.c
parentd93e612d13baabe76a8f414aa5dfc5726d4845da (diff)
downloadlinux-6f3cdf2bf1ba9b70de6c2921a415951a0d59873b.tar.gz
linux-6f3cdf2bf1ba9b70de6c2921a415951a0d59873b.tar.bz2
linux-6f3cdf2bf1ba9b70de6c2921a415951a0d59873b.zip
serial: pic32: fix missing clk_disable_unprepare() on error in pic32_uart_startup()
Fix the missing clk_disable_unprepare() before return from pic32_uart_startup() in the error handling case. Fixes: 157b9394709e ("serial: pic32_uart: Add PIC32 UART driver") Reported-by: Hulk Robot <hulkci@huawei.com> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220525021204.2407631-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/pic32_uart.c')
-rw-r--r--drivers/tty/serial/pic32_uart.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
index b399aac530fe..f418f1de66b3 100644
--- a/drivers/tty/serial/pic32_uart.c
+++ b/drivers/tty/serial/pic32_uart.c
@@ -503,7 +503,7 @@ static int pic32_uart_startup(struct uart_port *port)
if (!sport->irq_fault_name) {
dev_err(port->dev, "%s: kasprintf err!", __func__);
ret = -ENOMEM;
- goto out_done;
+ goto out_disable_clk;
}
irq_set_status_flags(sport->irq_fault, IRQ_NOAUTOEN);
ret = request_irq(sport->irq_fault, pic32_uart_fault_interrupt,
@@ -579,6 +579,8 @@ out_r:
out_f:
free_irq(sport->irq_fault, port);
kfree(sport->irq_fault_name);
+out_disable_clk:
+ clk_disable_unprepare(sport->clk);
out_done:
return ret;
}