diff options
Diffstat (limited to 'amdgpu')
-rw-r--r-- | amdgpu/amdgpu_cs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 72a2465c..91e6bcfc 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c | |||
@@ -635,6 +635,12 @@ static int amdgpu_cs_create_bo_list(amdgpu_device_handle dev, | |||
635 | int r; | 635 | int r; |
636 | 636 | ||
637 | num_resources = request->number_of_resources; | 637 | num_resources = request->number_of_resources; |
638 | |||
639 | if (!num_resources) { | ||
640 | *handle = 0; | ||
641 | return 0; | ||
642 | } | ||
643 | |||
638 | if (fence_ib) | 644 | if (fence_ib) |
639 | ++num_resources; | 645 | ++num_resources; |
640 | 646 | ||
@@ -671,6 +677,9 @@ static int amdgpu_cs_free_bo_list(amdgpu_device_handle dev, uint32_t handle) | |||
671 | union drm_amdgpu_bo_list args; | 677 | union drm_amdgpu_bo_list args; |
672 | int r; | 678 | int r; |
673 | 679 | ||
680 | if (!handle) | ||
681 | return 0; | ||
682 | |||
674 | memset(&args, 0, sizeof(args)); | 683 | memset(&args, 0, sizeof(args)); |
675 | args.in.operation = AMDGPU_BO_LIST_OP_DESTROY; | 684 | args.in.operation = AMDGPU_BO_LIST_OP_DESTROY; |
676 | args.in.list_handle = handle; | 685 | args.in.list_handle = handle; |