Skip to content

Commit e5d295b

Browse files
sumanannarafaeljw
authored andcommitted
cpufreq: ti-cpufreq: Fix an incorrect error return value
Commit 05829d9 (cpufreq: ti-cpufreq: kfree opp_data when failure) has fixed a memory leak in the failure path, however the patch returned a positive value on get_cpu_device() failure instead of the previous negative value. Fix this incorrect error return value properly. Fixes: 05829d9 (cpufreq: ti-cpufreq: kfree opp_data when failure) Cc: 4.14+ <[email protected]> # v4.14+ Signed-off-by: Suman Anna <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 08e9cc4 commit e5d295b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cpufreq/ti-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int ti_cpufreq_probe(struct platform_device *pdev)
226226
opp_data->cpu_dev = get_cpu_device(0);
227227
if (!opp_data->cpu_dev) {
228228
pr_err("%s: Failed to get device for CPU0\n", __func__);
229-
ret = ENODEV;
229+
ret = -ENODEV;
230230
goto free_opp_data;
231231
}
232232

0 commit comments

Comments
 (0)