Commit f1543f58 authored by Nicolai Hähnle's avatar Nicolai Hähnle Committed by Alex Deucher

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: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: default avatarEdward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 36ea83d1
...@@ -408,6 +408,7 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev, ...@@ -408,6 +408,7 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
return 0; return 0;
fail_unreserve: fail_unreserve:
if (!resv)
ww_mutex_unlock(&bo->tbo.resv->lock); ww_mutex_unlock(&bo->tbo.resv->lock);
amdgpu_bo_unref(&bo); amdgpu_bo_unref(&bo);
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment