Skip to content

Commit

Permalink
drm/amd/amdgpu: fix locking in bo creation error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolai Hähnle authored and Alex Deucher committed Jan 27, 2017
1 parent 36ea83d commit f1543f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
return 0;

fail_unreserve:
ww_mutex_unlock(&bo->tbo.resv->lock);
if (!resv)
ww_mutex_unlock(&bo->tbo.resv->lock);
amdgpu_bo_unref(&bo);
return r;
}
Expand Down

0 comments on commit f1543f5

Please sign in to comment.