diff options
author | Christian König <christian.koenig@amd.com> | 2018-07-30 10:18:54 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-07-31 17:58:17 -0400 |
commit | 0cb7c1f03bfb3991120313c5927c1749041ef800 (patch) | |
tree | 0c841abfdfe5dda5babed44dd59850b0deca0e5a /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | 275105ce7be37a2cc80eb1b60e6526355f54df94 (diff) |
drm/amdgpu: return error if both BOs and bo_list handle is given
Return -EINVAL when both the BOs as well as a list handle is provided in
the IOCTL.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 8a49c3b97bd4..d41cea78e4aa 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -572,14 +572,17 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, | |||
572 | INIT_LIST_HEAD(&p->validated); | 572 | INIT_LIST_HEAD(&p->validated); |
573 | 573 | ||
574 | /* p->bo_list could already be assigned if AMDGPU_CHUNK_ID_BO_HANDLES is present */ | 574 | /* p->bo_list could already be assigned if AMDGPU_CHUNK_ID_BO_HANDLES is present */ |
575 | if (p->bo_list) { | 575 | if (cs->in.bo_list_handle) { |
576 | mutex_lock(&p->bo_list->lock); | 576 | if (p->bo_list) |
577 | return -EINVAL; | ||
577 | 578 | ||
578 | } else if (cs->in.bo_list_handle) { | ||
579 | r = amdgpu_bo_list_get(fpriv, cs->in.bo_list_handle, | 579 | r = amdgpu_bo_list_get(fpriv, cs->in.bo_list_handle, |
580 | &p->bo_list); | 580 | &p->bo_list); |
581 | if (r) | 581 | if (r) |
582 | return r; | 582 | return r; |
583 | |||
584 | } else if (p->bo_list) { | ||
585 | mutex_lock(&p->bo_list->lock); | ||
583 | } | 586 | } |
584 | 587 | ||
585 | if (p->bo_list) { | 588 | if (p->bo_list) { |