diff options
| author | Jinjie Ruan <ruanjinjie@huawei.com> | 2024-11-07 19:38:41 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 14:02:51 +0100 |
| commit | 941202d8c326037813317fb6a4266d7f343d3d05 (patch) | |
| tree | 65f7fb500e2b2ed2eb2c600a19b9ca351e496ae3 /kernel/livepatch/patch.c | |
| parent | 77f53f49ad628429cf0664d3df3ee7df41b4a7d8 (diff) | |
| download | linux-941202d8c326037813317fb6a4266d7f343d3d05.tar.gz linux-941202d8c326037813317fb6a4266d7f343d3d05.tar.bz2 linux-941202d8c326037813317fb6a4266d7f343d3d05.zip | |
cpufreq: mediatek-hw: Fix wrong return value in mtk_cpufreq_get_cpu_power()
commit 172bf5ed04cb6c9e66d58de003938ed5c8756570 upstream.
mtk_cpufreq_get_cpu_power() return 0 if the policy is NULL. Then in
em_create_perf_table(), the later zero check for power is not invalid
as power is uninitialized. As Lukasz suggested, it must return -EINVAL when
the 'policy' is not found. So return -EINVAL to fix it.
Cc: stable@vger.kernel.org
Fixes: 4855e26bcf4d ("cpufreq: mediatek-hw: Add support for CPUFREQ HW")
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Suggested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/livepatch/patch.c')
0 files changed, 0 insertions, 0 deletions
