Skip to content

Commit 017496a

Browse files
mszyprowGeorgi Djakov
authored andcommitted
interconnect: fix memory trashing in of_count_icc_providers()
of_count_icc_providers() function uses for_each_available_child_of_node() helper to recursively check all the available nodes. This helper already properly handles child nodes' reference count, so there is no need to do it explicitly. Remove the excessive call to of_node_put(). This fixes memory trashing when CONFIG_OF_DYNAMIC is enabled (for example arm/multi_v7_defconfig). Fixes: b1d681d ("interconnect: Add sync state support") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20201119103746.32564-1-m.szyprowski@samsung.com Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
1 parent 7ab1e91 commit 017496a

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

‎drivers/interconnect/core.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,6 @@ static int of_count_icc_providers(struct device_node *np)
10831083
count++;
10841084
count += of_count_icc_providers(child);
10851085
}
1086-
of_node_put(np);
10871086

10881087
return count;
10891088
}

0 commit comments

Comments
 (0)