Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <lijo.lazar@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
582bf7c5 712d98c7

+2 -1
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
··· 55 55 56 56 bool amdgpu_nbio_is_replay_cnt_supported(struct amdgpu_device *adev) 57 57 { 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 || 59 60 (!adev->nbio.funcs || !adev->nbio.funcs->get_pcie_replay_count)) 60 61 return false; 61 62