Skip to content

Commit 9349775

Browse files
Qianqiang Liusuperm1
authored andcommitted
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]>
1 parent 3e39e68 commit 9349775

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cpufreq/amd-pstate-ut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static int amd_pstate_set_mode(enum amd_pstate_mode mode)
267267

268268
static void amd_pstate_ut_check_driver(u32 index)
269269
{
270-
enum amd_pstate_mode mode1, mode2;
270+
enum amd_pstate_mode mode1, mode2 = AMD_PSTATE_DISABLE;
271271
int ret;
272272

273273
for (mode1 = AMD_PSTATE_DISABLE; mode1 < AMD_PSTATE_MAX; mode1++) {

0 commit comments

Comments
 (0)