Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/pm: Fix uninitialized variable agc_btc_response

Assign an default value to agc_btc_response in failed case

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Ma Jun and committed by
Alex Deucher
df4409d8 336c8f55

+7 -2
+7 -2
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
··· 2361 2361 { 2362 2362 struct vega10_hwmgr *data = hwmgr->backend; 2363 2363 uint32_t agc_btc_response; 2364 + int ret; 2364 2365 2365 2366 if (data->smu_features[GNLD_ACG].supported) { 2366 2367 if (0 == vega10_enable_smc_features(hwmgr, true, 2367 2368 data->smu_features[GNLD_DPM_PREFETCHER].smu_feature_bitmap)) 2368 2369 data->smu_features[GNLD_DPM_PREFETCHER].enabled = true; 2369 2370 2370 - smum_send_msg_to_smc(hwmgr, PPSMC_MSG_InitializeAcg, NULL); 2371 + ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_InitializeAcg, NULL); 2372 + if (ret) 2373 + return ret; 2371 2374 2372 - smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc, &agc_btc_response); 2375 + ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc, &agc_btc_response); 2376 + if (ret) 2377 + agc_btc_response = 0; 2373 2378 2374 2379 if (1 == agc_btc_response) { 2375 2380 if (1 == data->acg_loop_state)