> @@ -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;
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
2 matches
Mail list logo