mips: mti-malta: Fix refcount leak in malta-time.c
authorLiang He <windhl@126.com>
Thu, 16 Jun 2022 14:27:56 +0000 (22:27 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 21 Jun 2022 15:04:30 +0000 (17:04 +0200)
In update_gic_frequency_dt(), of_find_compatible_node() will return
a node pointer with refcount incremented. We should use of_node_put()
when it is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/mti-malta/malta-time.c

index bbf1e38..2cb708c 100644 (file)
@@ -214,6 +214,8 @@ static void update_gic_frequency_dt(void)
 
        if (of_update_property(node, &gic_frequency_prop) < 0)
                pr_err("error updating gic frequency property\n");
+
+       of_node_put(node);
 }
 
 #endif