Skip to content

Commit 582bf7c

Browse files
Lijo Lazaralexdeucher
authored andcommitted
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]>
1 parent 712d98c commit 582bf7c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ u64 amdgpu_nbio_get_pcie_replay_count(struct amdgpu_device *adev)
5555

5656
bool amdgpu_nbio_is_replay_cnt_supported(struct amdgpu_device *adev)
5757
{
58-
if (amdgpu_sriov_vf(adev) || !adev->asic_funcs->get_pcie_replay_count ||
58+
if (amdgpu_sriov_vf(adev) || !adev->asic_funcs ||
59+
!adev->asic_funcs->get_pcie_replay_count ||
5960
(!adev->nbio.funcs || !adev->nbio.funcs->get_pcie_replay_count))
6061
return false;
6162

0 commit comments

Comments
 (0)