From: jsg Date: Mon, 9 Sep 2024 09:33:21 +0000 (+0000) Subject: drm/amdgpu: fix the waring dereferencing hive X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=99dcd02b784a6b5cceb6c35fcfc710db14459446;p=openbsd drm/amdgpu: fix the waring dereferencing hive From Jesse Zhang 4ab720b6aa1ef5e71db1e534b5b45c80ac4ec58a in linux-6.6.y/6.6.50 1940708ccf5aff76de4e0b399f99267c93a89193 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c index d57ba08276d..5c146c81ce7 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c @@ -1336,6 +1336,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;