Commit e78adc5a authored by Likun Gao's avatar Likun Gao Committed by Alex Deucher

drm/amdgpu/powerplay: fix NULL pointer issue when SMU disabled

Fix smu related NULL pointer issue which occurs when SMU is disabled.
Signed-off-by: default avatarLikun Gao <Likun.Gao@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d2f925ff
......@@ -1904,8 +1904,14 @@ int smu_write_watermarks_table(struct smu_context *smu)
int smu_set_watermarks_for_clock_ranges(struct smu_context *smu,
struct dm_pp_wm_sets_with_clock_ranges_soc15 *clock_ranges)
{
struct smu_table *watermarks = &smu->smu_table.tables[SMU_TABLE_WATERMARKS];
void *table = watermarks->cpu_addr;
struct smu_table *watermarks;
void *table;
if (!smu->smu_table.tables)
return 0;
watermarks = &smu->smu_table.tables[SMU_TABLE_WATERMARKS];
table = watermarks->cpu_addr;
mutex_lock(&smu->mutex);
......@@ -2397,7 +2403,7 @@ bool smu_baco_is_support(struct smu_context *smu)
mutex_lock(&smu->mutex);
if (smu->ppt_funcs->baco_is_support)
if (smu->ppt_funcs && smu->ppt_funcs->baco_is_support)
ret = smu->ppt_funcs->baco_is_support(smu);
mutex_unlock(&smu->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment