aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQianqiang Liu <[email protected]>2024-09-11 07:39:24 +0800
committerMario Limonciello <[email protected]>2024-09-11 10:53:03 -0500
commit93497752dfed196b41d2804503e80b9a04318adb (patch)
treeeae4fc9fcf75995f666862ff4dc2418cfa1727e3
parent3e39e68dfbb6d4fe8c1943003d2f2a6f3255c902 (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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Mario Limonciello <[email protected]> Signed-off-by: Mario Limonciello <[email protected]>
-rw-r--r--drivers/cpufreq/amd-pstate-ut.c2
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++) {