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 <[email protected]>
Cc: Eduardo Valentin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Ulises Brindis <[email protected]>
Signed-off-by: Eduardo Valentin <[email protected]>
This commit is contained in:
Ulises Brindis 2016-03-25 12:55:41 -07:00 • committed by Eduardo Valentin
commit 1cd91c1820

View file

@ -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: