ANDROID: PM / OPP: Add missing of_node_put() to power estimation helper

of_dev_pm_get_cpu_power() fails to properly decrement the refcount of
the device_node used to read the CPU capacitance.

Fix this.

Bug: 120440300
Fixes: d326aa36e6 ("ANDROID: PM / OPP: cpufreq-dt: Move power
estimation function")
Change-Id: I860b00a78710b543c5f3746f3ef35179de22ff01
Signed-off-by: Quentin Perret <quentin.perret@arm.com>
This commit is contained in:
Quentin Perret 2018-12-19 17:08:40 +00:00 committed by Alistair Strachan
parent 2e0d7ea44a
commit edf68da31b

View File

@ -787,6 +787,7 @@ int of_dev_pm_opp_get_cpu_power(unsigned long *mW, unsigned long *KHz, int cpu)
struct device_node *np;
u32 cap;
u64 tmp;
int ret;
cpu_dev = get_cpu_device(cpu);
if (!cpu_dev)
@ -796,7 +797,9 @@ int of_dev_pm_opp_get_cpu_power(unsigned long *mW, unsigned long *KHz, int cpu)
if (!np)
return -EINVAL;
if (of_property_read_u32(np, "dynamic-power-coefficient", &cap))
ret = of_property_read_u32(np, "dynamic-power-coefficient", &cap);
of_node_put(np);
if (ret)
return -EINVAL;
Hz = *KHz * 1000;