drm/amdgpu: Actually check flags for all context ops.
authorjsg <jsg@openbsd.org>
Fri, 30 Aug 2024 03:39:16 +0000 (03:39 +0000)
committerjsg <jsg@openbsd.org>
Fri, 30 Aug 2024 03:39:16 +0000 (03:39 +0000)
From Bas Nieuwenhuizen
2685a2b9e55db1d0f34dcab863c7cc0842e7df15 in linux-6.6.y/6.6.48
0573a1e2ea7e35bff08944a40f1adf2bb35cea61 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_ctx.c

index 5bd66da..1e476a7 100644 (file)
@@ -684,16 +684,24 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,
 
        switch (args->in.op) {
        case AMDGPU_CTX_OP_ALLOC_CTX:
+               if (args->in.flags)
+                       return -EINVAL;
                r = amdgpu_ctx_alloc(adev, fpriv, filp, priority, &id);
                args->out.alloc.ctx_id = id;
                break;
        case AMDGPU_CTX_OP_FREE_CTX:
+               if (args->in.flags)
+                       return -EINVAL;
                r = amdgpu_ctx_free(fpriv, id);
                break;
        case AMDGPU_CTX_OP_QUERY_STATE:
+               if (args->in.flags)
+                       return -EINVAL;
                r = amdgpu_ctx_query(adev, fpriv, id, &args->out);
                break;
        case AMDGPU_CTX_OP_QUERY_STATE2:
+               if (args->in.flags)
+                       return -EINVAL;
                r = amdgpu_ctx_query2(adev, fpriv, id, &args->out);
                break;
        case AMDGPU_CTX_OP_GET_STABLE_PSTATE: