提交 7584498c 编写于 作者: H Huang Rui 提交者: Alex Deucher

drm/amd/powerplay: fix missed hwmgr check warning before call gfx_off_control handler

Patch 9667849b: "drm/amd/powerplay: add control gfxoff enabling in late
init" from Mar 13, 2018, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c:194
pp_late_init()
	error: we previously assumed 'hwmgr' could be null (see line 185)

drivers/gpu/drm/amd/amdgpu/../powerplay/amd_powerplay.c

This patch fixes the warning to add hwmgr checking.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NHuang Rui <ray.huang@amd.com>
Reviewed-by: NEvan Quan <evan.quan@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 06b18f61
......@@ -191,7 +191,8 @@ static int pp_late_init(void *handle)
if (adev->pm.smu_prv_buffer_size != 0)
pp_reserve_vram_for_smu(adev);
if (hwmgr->hwmgr_func->gfx_off_control &&
if (hwmgr && hwmgr->hwmgr_func &&
hwmgr->hwmgr_func->gfx_off_control &&
(hwmgr->feature_mask & PP_GFXOFF_MASK)) {
ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr, true);
if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册