]> Git Repo - linux.git/commitdiff
drm/amdgpu: add check for ras error type
authorTao Zhou <[email protected]>
Tue, 23 Jul 2019 05:07:24 +0000 (13:07 +0800)
committerAlex Deucher <[email protected]>
Wed, 31 Jul 2019 19:50:35 +0000 (14:50 -0500)
only ue and ce errors are supported

Signed-off-by: Tao Zhou <[email protected]>
Reviewed-by: Dennis Li <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index b248c8250d7548dbab02513e2a6cfe504c7b9479..69a1ba499efaea0689b7744fc232942adb370604 100644 (file)
@@ -155,9 +155,14 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f,
                        return -EINVAL;
 
                data->head.block = block_id;
-               data->head.type = memcmp("ue", err, 2) == 0 ?
-                       AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE :
-                       AMDGPU_RAS_ERROR__SINGLE_CORRECTABLE;
+               /* only ue and ce errors are supported */
+               if (!memcmp("ue", err, 2))
+                       data->head.type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE;
+               else if (!memcmp("ce", err, 2))
+                       data->head.type = AMDGPU_RAS_ERROR__SINGLE_CORRECTABLE;
+               else
+                       return -EINVAL;
+
                data->op = op;
 
                if (op == 2) {
This page took 0.060526 seconds and 4 git commands to generate.