diff options
| author | Jesse Zhang <[email protected]> | 2024-05-08 08:20:49 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-05-13 20:11:53 +0000 |
| commit | 1940708ccf5aff76de4e0b399f99267c93a89193 (patch) | |
| tree | b291acc395d4acdbd1686ea2965fb41bc74aa7ea /drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |
| parent | drm/amdgpu: fix dereference after null check (diff) | |
| download | kernel-1940708ccf5aff76de4e0b399f99267c93a89193.tar.gz kernel-1940708ccf5aff76de4e0b399f99267c93a89193.zip | |
drm/amdgpu: fix the waring dereferencing hive
Check the amdgpu_hive_info *hive that maybe is NULL.
Signed-off-by: Jesse Zhang <[email protected]>
Reviewed-by: Tim Huang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 37820dd03cab..5a648a657dc6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -1362,6 +1362,9 @@ static void psp_xgmi_reflect_topology_info(struct psp_context *psp, uint8_t dst_num_links = node_info.num_links; hive = amdgpu_get_xgmi_hive(psp->adev); + if (WARN_ON(!hive)) + return; + list_for_each_entry(mirror_adev, &hive->device_list, gmc.xgmi.head) { struct psp_xgmi_topology_info *mirror_top_info; int j; |
