Skip to content

Commit 580d952

Browse files
SamuelZOUgregkh
authored andcommitted
tty: serial: bcm63xx: fix missing clk_put() in bcm63xx_uart
This patch fixes below error reported by coccicheck drivers/tty/serial/bcm63xx_uart.c:848:2-8: ERROR: missing clk_put; clk_get on line 842 and execution via conditional on line 846 Fixes: ab4382d ("tty: move drivers/serial/ to drivers/tty/serial/") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zou Wei <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2717769 commit 580d952

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/tty/serial/bcm63xx_uart.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,10 @@ static int bcm_uart_probe(struct platform_device *pdev)
843843
if (IS_ERR(clk) && pdev->dev.of_node)
844844
clk = of_clk_get(pdev->dev.of_node, 0);
845845

846-
if (IS_ERR(clk))
846+
if (IS_ERR(clk)) {
847+
clk_put(clk);
847848
return -ENODEV;
849+
}
848850

849851
port->iotype = UPIO_MEM;
850852
port->irq = res_irq->start;

0 commit comments

Comments
 (0)