diff options
author | Qianqiang Liu <qianqiang.liu@163.com> | 2024-09-11 07:39:24 +0800 |
---|---|---|
committer | Mario Limonciello <mario.limonciello@amd.com> | 2024-09-11 10:53:03 -0500 |
commit | 93497752dfed196b41d2804503e80b9a04318adb (patch) | |
tree | eae4fc9fcf75995f666862ff4dc2418cfa1727e3 | |
parent | 3e39e68dfbb6d4fe8c1943003d2f2a6f3255c902 (diff) |
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: Qianqiang Liu <qianqiang.liu@163.com>
Link: https://lore.kernel.org/r/20240910233923.46470-1-qianqiang.liu@163.com
Acked-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-rw-r--r-- | drivers/cpufreq/amd-pstate-ut.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c index 24432bd78a5a..d52f26d1ffba 100644 --- a/drivers/cpufreq/amd-pstate-ut.c +++ b/drivers/cpufreq/amd-pstate-ut.c @@ -267,7 +267,7 @@ static int amd_pstate_set_mode(enum amd_pstate_mode mode) 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; for (mode1 = AMD_PSTATE_DISABLE; mode1 < AMD_PSTATE_MAX; mode1++) { |