From: Jesse Zhang Date: Sun, 28 Apr 2024 07:36:26 +0000 (+0800) Subject: drm/amd/pm: fix uninitialized variable warning X-Git-Tag: v6.11-rc1~141^2~25^2~510 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c836905520703dbc8b938993b6d4d718bc739f3;p=thirdparty%2Fkernel%2Flinux.git drm/amd/pm: fix uninitialized variable warning Check the return of function smum_send_msg_to_smc as it may fail to initialize the variable. Signed-off-by: Jesse Zhang Reviewed-by: Yang Wang Reviewed-by: Tim Huang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c index 5fb21a0508cd9..1c40a362d5ab4 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c @@ -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; /*