summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c
index 65db7e29cc3..36af1f4e451 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ras.c
@@ -1029,6 +1029,9 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev,
if (!obj)
return -EINVAL;
+ if (!info || info->head.block == AMDGPU_RAS_BLOCK_COUNT)
+ return -EINVAL;
+
if (info->head.block == AMDGPU_RAS_BLOCK__UMC) {
amdgpu_ras_get_ecc_info(adev, &err_data);
} else {