Re: [PATCH v2 04/15] ARM: hisi: fix a leaked reference by adding missing of_node_put

2019-04-05 Thread Markus Elfring
> @@ -285,12 +286,14 @@ static int __init hip04_smp_init(void) > if (!np_sctl) > goto err; > np_fab = of_find_compatible_node(NULL, NULL, "hisilicon,hip04-fabric"); > - if (!np_fab) > + if (!np_fab) { > + of_node_put(np_sctl); > goto err;

[PATCH v2 04/15] ARM: hisi: fix a leaked reference by adding missing of_node_put

2019-03-05 Thread Wen Yang
The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-hisi/platsmp.c:74:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount