drm/amdgpu: Checked if the pointer NULL before use it.
authorGavin Wan <Gavin.Wan@amd.com>
Fri, 17 Mar 2023 22:42:30 +0000 (18:42 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:58:09 +0000 (09:58 -0400)
commitb4520bfd801338c48d887f0eec74a53ab80f2167
tree509570dc323244ec600d29fcb6d9fbf2333488e0
parent46f7b4deb30558593c1d2e62d561a3cee21f558a
drm/amdgpu: Checked if the pointer NULL before use it.

For SRIOV on some parts, the host driver does not post VBIOS. So the guest
cannot get bios information. Therefore, adev->virt.fw_reserve.p_pf2vf
and adev->mode_info.atom_context are NULL.

Signed-off-by: Gavin Wan <Gavin.Wan@amd.com>
Reviewed-by: Zhigang Luo <Zhigang.Luo@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c