* [PATCH] thermal: of: fix cleanup when building a thermal zone
@ 2016-03-25 19:55 Ulises Brindis
2016-03-28 13:43 ` Eduardo Valentin
0 siblings, 1 reply; 2+ messages in thread
From: Ulises Brindis @ 2016-03-25 19:55 UTC (permalink / raw)
Cc: Ulises Brindis, Zhang Rui, Eduardo Valentin, linux-pm,
linux-kernel
of_node_put is iterating through all terms in the tbps array even though
the bind has failed. We need to only iterate through the terms that have
already passed the binding step.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ulises Brindis <brindisu@lab126.com>
---
drivers/thermal/of-thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 9043f8f..0f1c420 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -825,7 +825,7 @@ finish:
return tz;
free_tbps:
- for (i = 0; i < tz->num_tbps; i++)
+ for (i = i - 1; i >= 0; i--)
of_node_put(tz->tbps[i].cooling_device);
kfree(tz->tbps);
free_trips:
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal: of: fix cleanup when building a thermal zone
2016-03-25 19:55 [PATCH] thermal: of: fix cleanup when building a thermal zone Ulises Brindis
@ 2016-03-28 13:43 ` Eduardo Valentin
0 siblings, 0 replies; 2+ messages in thread
From: Eduardo Valentin @ 2016-03-28 13:43 UTC (permalink / raw)
To: Ulises Brindis; +Cc: Zhang Rui, linux-pm, linux-kernel
On Fri, Mar 25, 2016 at 12:55:41PM -0700, Ulises Brindis wrote:
> of_node_put is iterating through all terms in the tbps array even though
> the bind has failed. We need to only iterate through the terms that have
> already passed the binding step.
Thanks for your patch. Queueing into my -fixes branch.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-28 13:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-25 19:55 [PATCH] thermal: of: fix cleanup when building a thermal zone Ulises Brindis
2016-03-28 13:43 ` Eduardo Valentin
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).