]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer
authorLu Yao <yaolu@kylinos.cn>
Thu, 23 Nov 2023 01:22:34 +0000 (09:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Jan 2024 10:50:04 +0000 (11:50 +0100)
commit53a37135f763ecd02e3ade4f05317eaa8638e39b
tree48e1b69133e56add1d339a92a5af954201005ee9
parentd551c77727b7177ca4915128b87a896e71343de9
drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer

[ Upstream commit 2161e09cd05a50d80736fe397145340d2e8f6c05 ]

For 'AMDGPU_FAMILY_SI' family cards, in 'si_common_early_init' func, init
'didt_rreg' and 'didt_wreg' to 'NULL'. But in func
'amdgpu_debugfs_regs_didt_read/write', using 'RREG32_DIDT' 'WREG32_DIDT'
lacks of relevant judgment. And other 'amdgpu_ip_block_version' that use
these two definitions won't be added for 'AMDGPU_FAMILY_SI'.

So, add null pointer judgment before calling.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Lu Yao <yaolu@kylinos.cn>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c