Commit 4a525e21 authored by Jesse Zhang's avatar Jesse Zhang Committed by Yi Yang
Browse files

drm/amdgpu: fix the waring dereferencing hive

stable inclusion
from stable-v6.6.50
commit 4ab720b6aa1ef5e71db1e534b5b45c80ac4ec58a
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9PU
CVE: CVE-2024-46805

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4ab720b6aa1ef5e71db1e534b5b45c80ac4ec58a



--------------------------------

[ Upstream commit 1940708ccf5aff76de4e0b399f99267c93a89193 ]

Check the amdgpu_hive_info *hive that maybe is NULL.

Signed-off-by: default avatarJesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: default avatarTim Huang <Tim.Huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYi Yang <yiyang13@huawei.com>
parent 02f95e7a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;