Commit 6540ff64 authored by Lang Yu's avatar Lang Yu Committed by Alex Deucher

drm/amdgpu: fix mmhub client id out-of-bounds access

Properly handle cid 0x140.

Fixes: aba2be41 ("drm/amdgpu: add mmhub 3.3.0 support")
Signed-off-by: default avatarLang Yu <Lang.Yu@amd.com>
Reviewed-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 22207fd5
...@@ -99,16 +99,15 @@ mmhub_v3_3_print_l2_protection_fault_status(struct amdgpu_device *adev, ...@@ -99,16 +99,15 @@ mmhub_v3_3_print_l2_protection_fault_status(struct amdgpu_device *adev,
switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) { switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) {
case IP_VERSION(3, 3, 0): case IP_VERSION(3, 3, 0):
case IP_VERSION(3, 3, 1): case IP_VERSION(3, 3, 1):
mmhub_cid = mmhub_client_ids_v3_3[cid][rw]; mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_v3_3) ?
mmhub_client_ids_v3_3[cid][rw] :
cid == 0x140 ? "UMSCH" : NULL;
break; break;
default: default:
mmhub_cid = NULL; mmhub_cid = NULL;
break; break;
} }
if (!mmhub_cid && cid == 0x140)
mmhub_cid = "UMSCH";
dev_err(adev->dev, "\t Faulty UTCL2 client ID: %s (0x%x)\n", dev_err(adev->dev, "\t Faulty UTCL2 client ID: %s (0x%x)\n",
mmhub_cid ? mmhub_cid : "unknown", cid); mmhub_cid ? mmhub_cid : "unknown", cid);
dev_err(adev->dev, "\t MORE_FAULTS: 0x%lx\n", dev_err(adev->dev, "\t MORE_FAULTS: 0x%lx\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment