diff mbox

[libdrm,1/3] amdgpu: add missing unlock on drmPrimeFDToHandle() failure

Message ID 20170122184813.12995-1-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Velikov Jan. 22, 2017, 6:48 p.m. UTC
Cc: amd-gfx@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 amdgpu/amdgpu_bo.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Nicolai Hähnle Jan. 23, 2017, 4:15 p.m. UTC | #1
On 22.01.2017 19:48, Emil Velikov wrote:
> Cc: amd-gfx@lists.freedesktop.org
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>

> ---
>  amdgpu/amdgpu_bo.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
> index d30fd1e7..c9f31587 100644
> --- a/amdgpu/amdgpu_bo.c
> +++ b/amdgpu/amdgpu_bo.c
> @@ -302,6 +302,7 @@ int amdgpu_bo_import(amdgpu_device_handle dev,
>  		/* Get a KMS handle. */
>  		r = drmPrimeFDToHandle(dev->fd, shared_handle, &handle);
>  		if (r) {
> +			pthread_mutex_unlock(&dev->bo_table_mutex);
>  			return r;
>  		}
>
>
diff mbox

Patch

diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index d30fd1e7..c9f31587 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -302,6 +302,7 @@  int amdgpu_bo_import(amdgpu_device_handle dev,
 		/* Get a KMS handle. */
 		r = drmPrimeFDToHandle(dev->fd, shared_handle, &handle);
 		if (r) {
+			pthread_mutex_unlock(&dev->bo_table_mutex);
 			return r;
 		}