Commit 93497752 authored by Qianqiang Liu's avatar Qianqiang Liu Committed by Mario Limonciello

cpufreq/amd-pstate-ut: Fix an "Uninitialized variables" issue

Using uninitialized value "mode2" when calling "amd_pstate_get_mode_string".
Set "mode2" to "AMD_PSTATE_DISABLE" by default.
Signed-off-by: default avatarQianqiang Liu <qianqiang.liu@163.com>
Link: https://lore.kernel.org/r/20240910233923.46470-1-qianqiang.liu@163.comAcked-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
parent 3e39e68d
...@@ -267,7 +267,7 @@ static int amd_pstate_set_mode(enum amd_pstate_mode mode) ...@@ -267,7 +267,7 @@ static int amd_pstate_set_mode(enum amd_pstate_mode mode)
static void amd_pstate_ut_check_driver(u32 index) static void amd_pstate_ut_check_driver(u32 index)
{ {
enum amd_pstate_mode mode1, mode2; enum amd_pstate_mode mode1, mode2 = AMD_PSTATE_DISABLE;
int ret; int ret;
for (mode1 = AMD_PSTATE_DISABLE; mode1 < AMD_PSTATE_MAX; mode1++) { for (mode1 = AMD_PSTATE_DISABLE; mode1 < AMD_PSTATE_MAX; mode1++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment