mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 06:01:53 +02:00
drm/amdgpu: validate user queue parameters
Make sure these are set properly to ensure compatibility if we ever update the IOCTL interface. Reviewed-by: Prike Liang <Prike.Liang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
ad6c120f68
commit
158bfbc72c
|
|
@ -380,12 +380,26 @@ int amdgpu_userq_ioctl(struct drm_device *dev, void *data,
|
|||
|
||||
switch (args->in.op) {
|
||||
case AMDGPU_USERQ_OP_CREATE:
|
||||
if (args->in._pad)
|
||||
return -EINVAL;
|
||||
r = amdgpu_userqueue_create(filp, args);
|
||||
if (r)
|
||||
DRM_ERROR("Failed to create usermode queue\n");
|
||||
break;
|
||||
|
||||
case AMDGPU_USERQ_OP_FREE:
|
||||
if (args->in.ip_type ||
|
||||
args->in.doorbell_handle ||
|
||||
args->in.doorbell_offset ||
|
||||
args->in._pad ||
|
||||
args->in.queue_va ||
|
||||
args->in.queue_size ||
|
||||
args->in.rptr_va ||
|
||||
args->in.wptr_va ||
|
||||
args->in.wptr_va ||
|
||||
args->in.mqd ||
|
||||
args->in.mqd_size)
|
||||
return -EINVAL;
|
||||
r = amdgpu_userqueue_destroy(filp, args->in.queue_id);
|
||||
if (r)
|
||||
DRM_ERROR("Failed to destroy usermode queue\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user