]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/pm: fix uninitialized variable warning
authorJesse Zhang <jesse.zhang@amd.com>
Sun, 28 Apr 2024 07:36:26 +0000 (15:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 30 Apr 2024 13:59:26 +0000 (09:59 -0400)
Check the return of function smum_send_msg_to_smc
as it may fail to initialize the variable.

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c

index 5fb21a0508cd993acccf18cf632955740878590e..1c40a362d5ab4413a1ea7e35679e1f2c584ad797 100644 (file)
@@ -99,7 +99,7 @@ static void pp_swctf_delayed_work_handler(struct work_struct *work)
        struct amdgpu_device *adev = hwmgr->adev;
        struct amdgpu_dpm_thermal *range =
                                &adev->pm.dpm.thermal;
-       uint32_t gpu_temperature, size;
+       uint32_t gpu_temperature, size = sizeof(gpu_temperature);
        int ret;
 
        /*