]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Check if SW SMU is supported before accessing funcs
authorLeo Li <sunpeng.li@amd.com>
Thu, 18 Apr 2019 15:53:58 +0000 (11:53 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Apr 2019 22:27:25 +0000 (17:27 -0500)
commitb11fb5f92ff60a6bf60a9be1ef2966fd4759861b
tree269b8421a28e63de42bd5b1c05012b07cf67fc65
parent1137cf8d798ee089aba0a9581d5ac758f48f8aa8
drm/amdgpu: Check if SW SMU is supported before accessing funcs

smu.ppt_funcs is only initialized for ASICs supporting SW SMU.

On a Hawaii ASIC, attempting to access the udev attribute
ATTRS{power_dpm_state} will cause a null pointer deref in
amdgpu_get_dpm_state() because of this.

Fix by checking if SW SMU is supported first.

Signed-off-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c