Skip to content

Commit 425af48

Browse files
Zhengzengkaigregkh
authored andcommitted
serial: ar933x_uart: disable clk on error handling path in probe
ar933x_uart_probe() does not invoke clk_disable_unprepare() on one error handling path. This patch fixes that. Fixes: 9be1064 ("serial: ar933x_uart: add RS485 support") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> Link: https://lore.kernel.org/r/20201111124426.42638-1-zhengzengkai@huawei.com Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e67c139 commit 425af48

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/tty/serial/ar933x_uart.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,10 @@ static int ar933x_uart_probe(struct platform_device *pdev)
789789
goto err_disable_clk;
790790

791791
up->gpios = mctrl_gpio_init(port, 0);
792-
if (IS_ERR(up->gpios) && PTR_ERR(up->gpios) != -ENOSYS)
793-
return PTR_ERR(up->gpios);
792+
if (IS_ERR(up->gpios) && PTR_ERR(up->gpios) != -ENOSYS) {
793+
ret = PTR_ERR(up->gpios);
794+
goto err_disable_clk;
795+
}
794796

795797
up->rts_gpiod = mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS);
796798

0 commit comments

Comments
 (0)