diff options
author | Ulises Brindis <brindisu@lab126.com> | 2016-03-25 12:55:41 -0700 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2016-05-17 07:28:24 -0700 |
commit | 1cd91c1820801267b5579fa65842cdf843c73c4d (patch) | |
tree | 4824374f73a5e5f9a93057bc0e3518e422ea1fb7 /drivers/thermal | |
parent | c212ed912b73f804d5f897ec0a84f58dfd3da9e1 (diff) | |
download | linux-stable-1cd91c1820801267b5579fa65842cdf843c73c4d.tar.gz linux-stable-1cd91c1820801267b5579fa65842cdf843c73c4d.tar.bz2 linux-stable-1cd91c1820801267b5579fa65842cdf843c73c4d.zip |
thermal: of: fix cleanup when building a thermal zone
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>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/of-thermal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index d8ec44b194d6..82dd82afa555 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -906,7 +906,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: |