smu_v15_0_set_single_dpm_table() queries fine-grained DPM status and
per-level frequencies from SMU; when DPM is disabled both callees
smu_v15_0_get_fine_grained_status() and
smu_v15_0_get_dpm_freq_by_index() return 0 without writing their output
arguments, leaving is_fine_grained and clk uninitialized before use.
Initialize both to zero to reflect the correct no-op semantics when DPM
is disabled.

Fixes: f7bee962d92a ("drm/amd/pm: Update dpm table structs for smu_v15_0")
Reported-by: Dan Carpenter <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>
Cc: Asad Kamal <[email protected]>
Cc: Lijo Lazar <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
---
 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c
index f1182305d707..29f444aea73a 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c
@@ -1249,8 +1249,8 @@ int smu_v15_0_set_single_dpm_table(struct smu_context 
*smu,
                                   struct smu_dpm_table *single_dpm_table)
 {
        int ret = 0;
-       uint32_t clk;
-       bool is_fine_grained;
+       u32 clk = 0;
+       bool is_fine_grained = false;
        int i;
 
        ret = smu_v15_0_get_dpm_level_count(smu,
-- 
2.34.1

Reply via email to