* [PATCH] interconnect: fix memory trashing in of_count_icc_providers() [not found] <CGME20201119103753eucas1p11810b99e19d0a8477b4ca84482ab4d16@eucas1p1.samsung.com> @ 2020-11-19 10:37 ` Marek Szyprowski 2020-11-19 13:52 ` Georgi Djakov 0 siblings, 1 reply; 2+ messages in thread From: Marek Szyprowski @ 2020-11-19 10:37 UTC (permalink / raw) To: linux-pm, linux-kernel, linux-arm-kernel, Georgi Djakov, Saravana Kannan Cc: Marek Szyprowski, Bartlomiej Zolnierkiewicz, Sylwester Nawrocki 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 explicitely. 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: b1d681d8d324 ("interconnect: Add sync state support") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> --- drivers/interconnect/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 974a66725d09..5ad519c9f239 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -1083,7 +1083,6 @@ static int of_count_icc_providers(struct device_node *np) count++; count += of_count_icc_providers(child); } - of_node_put(np); return count; } -- 2.17.1 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] interconnect: fix memory trashing in of_count_icc_providers() 2020-11-19 10:37 ` [PATCH] interconnect: fix memory trashing in of_count_icc_providers() Marek Szyprowski @ 2020-11-19 13:52 ` Georgi Djakov 0 siblings, 0 replies; 2+ messages in thread From: Georgi Djakov @ 2020-11-19 13:52 UTC (permalink / raw) To: Marek Szyprowski, linux-pm, linux-kernel, linux-arm-kernel, Saravana Kannan Cc: Bartlomiej Zolnierkiewicz, Sylwester Nawrocki On 11/19/20 12:37, Marek Szyprowski wrote: > 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 explicitely. 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: b1d681d8d324 ("interconnect: Add sync state support") > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Thanks Marek! BR, Georgi > --- > drivers/interconnect/core.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c > index 974a66725d09..5ad519c9f239 100644 > --- a/drivers/interconnect/core.c > +++ b/drivers/interconnect/core.c > @@ -1083,7 +1083,6 @@ static int of_count_icc_providers(struct device_node *np) > count++; > count += of_count_icc_providers(child); > } > - of_node_put(np); > > return count; > } > ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-19 13:52 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <CGME20201119103753eucas1p11810b99e19d0a8477b4ca84482ab4d16@eucas1p1.samsung.com> 2020-11-19 10:37 ` [PATCH] interconnect: fix memory trashing in of_count_icc_providers() Marek Szyprowski 2020-11-19 13:52 ` Georgi Djakov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).