Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1364826 > unrolled thread

[PATCH] thermal: of: fix cleanup when building a thermal zone

Started byUlises Brindis <brindisu@lab126.com>
First post2016-03-25 21:00 +0100
Last post2016-03-28 15:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] thermal: of: fix cleanup when building a thermal zone Ulises Brindis <brindisu@lab126.com> - 2016-03-25 21:00 +0100
    Re: [PATCH] thermal: of: fix cleanup when building a thermal zone Eduardo Valentin <edubezval@gmail.com> - 2016-03-28 15:50 +0200

#1364826 — [PATCH] thermal: of: fix cleanup when building a thermal zone

FromUlises Brindis <brindisu@lab126.com>
Date2016-03-25 21:00 +0100
Subject[PATCH] thermal: of: fix cleanup when building a thermal zone
Message-ID<rgG3M-6HW-11@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1365502

FromEduardo Valentin <edubezval@gmail.com>
Date2016-03-28 15:50 +0200
Message-ID<rhFIl-7PN-9@gated-at.bofh.it>
In reply to#1364826
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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web