Skip to content

Commit 9a6e91d

Browse files
tititiou36rafaeljw
authored andcommitted
cpufreq: ti: Fix 'of_node_put' being called twice in error handling path
If 'dev_pm_opp_set_supported_hw()' fails, 'opp_data->opp_node' refcount will be decremented 2 times. One, just a few lines above, and another one in the error handling path. Fix it by simply moving the 'of_node_put' call of the normal path. Signed-off-by: Christophe JAILLET <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent d79d148 commit 9a6e91d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cpufreq/ti-cpufreq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ static int ti_cpufreq_init(void)
245245
if (ret)
246246
goto fail_put_node;
247247

248-
of_node_put(opp_data->opp_node);
249-
250248
ret = PTR_ERR_OR_ZERO(dev_pm_opp_set_supported_hw(opp_data->cpu_dev,
251249
version, VERSION_COUNT));
252250
if (ret) {
@@ -255,6 +253,8 @@ static int ti_cpufreq_init(void)
255253
goto fail_put_node;
256254
}
257255

256+
of_node_put(opp_data->opp_node);
257+
258258
register_cpufreq_dt:
259259
platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
260260

0 commit comments

Comments
 (0)