Skip to contentSkip to conversation

tty:Insert clk_put before return (clk) to release memory

PATCH In review [email protected] 3 participants 3 messages Jul 14, 2023 1 message not in the archive TTY layer and serial drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 tty:Insert clk_put before return (clk) to release memory

tty/serial:Insert clk_put before return (clk) to release memory

---
 drivers/tty/serial/bcm63xx_uart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/bcm63xx_uart.c +1 -0
index 55e82d0bf92d..7353b683952d 100644
@@ -851,6 +851,7 @@ static int bcm_uart_probe(struct platform_device *pdev)
         clk = of_clk_get(pdev->dev.of_node, 0);
 
     if (IS_ERR(clk))
+        clk_put(clk);
         return -ENODEV;
 
     port->iotype = UPIO_MEM;
maintainer
#2 lore raw
Quoted 13 lines · On Fri, Jul 14, 2023 at 12:30:14PM +0800, [email protected] wrote:

tty/serial:Insert clk_put before return (clk) to release memory

---
 drivers/tty/serial/bcm63xx_uart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/bcm63xx_uart.c +0 -0
index 55e82d0bf92d..7353b683952d 100644

drivers/tty/serial/bcm63xx_uart.c static int bcm_uart_probe(struct platform_device *pdev) · line 857

Quoted 7 lines
drivers/tty/serial/bcm63xx_uart.c +1 -0
@@ -851,6 +851,7 @@ static int bcm_uart_probe(struct platform_device *pdev)
         clk = of_clk_get(pdev->dev.of_node, 0);
 
     if (IS_ERR(clk))
+        clk_put(clk);
         return -ENODEV;
 
     port->iotype = UPIO_MEM;

This obviously has not even been tested :(

#3 lore raw
In reply to [email protected]
Quoted 13 lines · On Fri, 14 Jul 2023, [email protected] wrote:

tty/serial:Insert clk_put before return (clk) to release memory

---
 drivers/tty/serial/bcm63xx_uart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/bcm63xx_uart.c +0 -0
index 55e82d0bf92d..7353b683952d 100644

drivers/tty/serial/bcm63xx_uart.c static int bcm_uart_probe(struct platform_device *pdev) · line 855

Quoted 5 lines
drivers/tty/serial/bcm63xx_uart.c +1 -0
@@ -851,6 +851,7 @@ static int bcm_uart_probe(struct platform_device *pdev)
         clk = of_clk_get(pdev->dev.of_node, 0);
 
     if (IS_ERR(clk))
+        clk_put(clk);
         return -ENODEV;

Braces missing... Didn't checkpatch complain about this?

Signature · 1 line
 i.