diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-09-09 09:12:22 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-09-09 09:12:22 +0000 |
commit | 6867b02b20807241feebd770502b6179bd082a5b (patch) | |
tree | 22dce2cd60d71dc4938a3a5cc7172cc69145a7a4 /sys/dev/pci/drm/amd/pm | |
parent | 16773c44fd51059a4fc5417ecba024573b75ddc8 (diff) |
drm/amdgpu/pm: Fix uninitialized variable agc_btc_response
From Ma Jun
3ad44174a5767dbe1dede02b160a4acfa9899d4f in linux-6.6.y/6.6.50
df4409d8a04dd39d7f2aa0c5f528a56b99eaaa13 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/amd/pm')
-rw-r--r-- | sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c b/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c index eaab03e7ea3..e6c3a6af556 100644 --- a/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +++ b/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c @@ -2361,15 +2361,20 @@ static int vega10_acg_enable(struct pp_hwmgr *hwmgr) { struct vega10_hwmgr *data = hwmgr->backend; uint32_t agc_btc_response; + int ret; if (data->smu_features[GNLD_ACG].supported) { if (0 == vega10_enable_smc_features(hwmgr, true, data->smu_features[GNLD_DPM_PREFETCHER].smu_feature_bitmap)) data->smu_features[GNLD_DPM_PREFETCHER].enabled = true; - smum_send_msg_to_smc(hwmgr, PPSMC_MSG_InitializeAcg, NULL); + ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_InitializeAcg, NULL); + if (ret) + return ret; - smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc, &agc_btc_response); + ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc, &agc_btc_response); + if (ret) + agc_btc_response = 0; if (1 == agc_btc_response) { if (1 == data->acg_loop_state) |