diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-01-10 14:36:56 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 11:13:29 -0500 |
commit | f1543f58cbc7f62c4ea0cca57bbb4a95dc752264 (patch) | |
tree | 3480c1f26eab6e82f0869ccca7b6b378bf570461 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 36ea83d1512008ab6631c54971e8de8cf2f0a7b4 (diff) |
drm/amd/amdgpu: fix locking in bo creation error path
Unlock the resv lock only if we were the ones to lock it in the first
place.
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index ac6b074b8821..7aecf2667f9d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -408,7 +408,8 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev, | |||
408 | return 0; | 408 | return 0; |
409 | 409 | ||
410 | fail_unreserve: | 410 | fail_unreserve: |
411 | ww_mutex_unlock(&bo->tbo.resv->lock); | 411 | if (!resv) |
412 | ww_mutex_unlock(&bo->tbo.resv->lock); | ||
412 | amdgpu_bo_unref(&bo); | 413 | amdgpu_bo_unref(&bo); |
413 | return r; | 414 | return r; |
414 | } | 415 | } |