mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpufreq/amd-pstate-ut: Fix an "Uninitialized variables" issue
@ 2024-09-10 23:39 Qianqiang Liu
  2024-09-11 16:02 ` Mario Limonciello
  0 siblings, 1 reply; 2+ messages in thread
From: Qianqiang Liu @ 2024-09-10 23:39 UTC (permalink / raw)
  To: ray.huang, gautham.shenoy, mario.limonciello, perry.yuan
  Cc: rafael, viresh.kumar, linux-pm, linux-kernel, Qianqiang Liu

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>
---
 drivers/cpufreq/amd-pstate-ut.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c
index c291b3dbec38..f66701514d90 100644
--- a/drivers/cpufreq/amd-pstate-ut.c
+++ b/drivers/cpufreq/amd-pstate-ut.c
@@ -270,7 +270,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++) {
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-11 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-10 23:39 [PATCH] cpufreq/amd-pstate-ut: Fix an "Uninitialized variables" issue Qianqiang Liu
2024-09-11 16:02 ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®