diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index 90d6fc1618aa..4792f9d0b7d4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | |||
@@ -118,6 +118,7 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev, | |||
118 | usermm = amdgpu_ttm_tt_get_usermm(entry->robj->tbo.ttm); | 118 | usermm = amdgpu_ttm_tt_get_usermm(entry->robj->tbo.ttm); |
119 | if (usermm) { | 119 | if (usermm) { |
120 | if (usermm != current->mm) { | 120 | if (usermm != current->mm) { |
121 | amdgpu_bo_unref(&entry->robj); | ||
121 | r = -EPERM; | 122 | r = -EPERM; |
122 | goto error_free; | 123 | goto error_free; |
123 | } | 124 | } |
@@ -151,6 +152,8 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev, | |||
151 | return 0; | 152 | return 0; |
152 | 153 | ||
153 | error_free: | 154 | error_free: |
155 | while (i--) | ||
156 | amdgpu_bo_unref(&array[i].robj); | ||
154 | drm_free_large(array); | 157 | drm_free_large(array); |
155 | return r; | 158 | return r; |
156 | } | 159 | } |