From: jsg Date: Fri, 30 Aug 2024 03:39:16 +0000 (+0000) Subject: drm/amdgpu: Actually check flags for all context ops. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ace50a5e7f6c5eae0d1dd2f9dc5d5c48e1e3d6a8;p=openbsd drm/amdgpu: Actually check flags for all context ops. From Bas Nieuwenhuizen 2685a2b9e55db1d0f34dcab863c7cc0842e7df15 in linux-6.6.y/6.6.48 0573a1e2ea7e35bff08944a40f1adf2bb35cea61 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ctx.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ctx.c index 5bd66da8bb7..1e476a723b8 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ctx.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ctx.c @@ -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: