]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/pm: Init pm_attr_list when dpm is disabled
authorZhenGuo Yin <zhenguo.yin@amd.com>
Wed, 12 Oct 2022 08:54:38 +0000 (16:54 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Oct 2022 02:12:36 +0000 (22:12 -0400)
commita747583d721ddabeee8b509079d412a8fc599451
treedcc3dcd47c99e138e755a8be230c4d4249b8ce3a
parent533bedd52aba844dfc1a639f4144766c8e86922d
drm/amd/pm: Init pm_attr_list when dpm is disabled

[Why]
In SRIOV multi-vf, dpm is always disabled, and pm_attr_list won't
be initialized. There will be a NULL pointer call trace after
removing the dpm check condition in amdgpu_pm_sysfs_fini.
BUG: kernel NULL pointer dereference, address: 0000000000000000
RIP: 0010:amdgpu_device_attr_remove_groups+0x20/0x90 [amdgpu]
Call Trace:
  <TASK>
  amdgpu_pm_sysfs_fini+0x2f/0x40 [amdgpu]
  amdgpu_device_fini_hw+0xdf/0x290 [amdgpu]

[How]
List pm_attr_list should be initialized when dpm is disabled.

Fixes: 419ad857e56a80 ("drm/amd/pm: Remove redundant check condition")
Signed-off-by: ZhenGuo Yin <zhenguo.yin@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c