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

* Re: [PATCH] cpufreq/amd-pstate-ut: Fix an "Uninitialized variables" issue
  2024-09-10 23:39 [PATCH] cpufreq/amd-pstate-ut: Fix an "Uninitialized variables" issue Qianqiang Liu
@ 2024-09-11 16:02 ` Mario Limonciello
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello @ 2024-09-11 16:02 UTC (permalink / raw)
  To: Qianqiang Liu, ray.huang, gautham.shenoy, perry.yuan
  Cc: rafael, viresh.kumar, linux-pm, linux-kernel

On 9/10/2024 18:39, Qianqiang Liu wrote:
> 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++) {

Acked-by: Mario Limonciello <mario.limonciello@amd.com>

Much appreciated.  I needed to redo the PR for 6.12 and I added this as 
well.


^ 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®