aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
diff options
context:
space:
mode:
authorLijo Lazar <[email protected]>2025-07-18 03:55:21 +0000
committerAlex Deucher <[email protected]>2025-08-04 19:47:50 +0000
commitc2fe914d50ab22defca14ac6fca33888bfb19843 (patch)
tree6251552d204e67e340e5086843bebcd6633988cc /drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
parentdrm/amd/display: Revert "drm/amd/display: Fix AMDGPU_MAX_BL_LEVEL value" (diff)
downloadkernel-c2fe914d50ab22defca14ac6fca33888bfb19843.tar.gz
kernel-c2fe914d50ab22defca14ac6fca33888bfb19843.zip
drm/amdgpu: Add NULL check for asic_funcs
If driver load fails too early, asic_funcs pointer remains unassigned. Add NULL check to sanitize unwind path. Signed-off-by: Lijo Lazar <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 582bf7c5158dce16f7dc5b8345b7876bd8031224) Cc: [email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
index e56ba93a8df6..a974265837f0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
@@ -55,7 +55,8 @@ u64 amdgpu_nbio_get_pcie_replay_count(struct amdgpu_device *adev)
bool amdgpu_nbio_is_replay_cnt_supported(struct amdgpu_device *adev)
{
- if (amdgpu_sriov_vf(adev) || !adev->asic_funcs->get_pcie_replay_count ||
+ if (amdgpu_sriov_vf(adev) || !adev->asic_funcs ||
+ !adev->asic_funcs->get_pcie_replay_count ||
(!adev->nbio.funcs || !adev->nbio.funcs->get_pcie_replay_count))
return false;