[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220129073524.31534-1-zhanglianjie@uniontech.com>
Date: Sat, 29 Jan 2022 15:35:23 +0800
From: zhanglianjie <zhanglianjie@...ontech.com>
To: Alex Deucher <alexander.deucher@....com>
Cc: linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
amd-gfx@...ts.freedesktop.org, Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>,
"Pan, Xinhui" <Xinhui.Pan@....com>,
Christian König <christian.koenig@....com>,
zhanglianjie <zhanglianjie@...ontech.com>
Subject: [PATCH 1/2] drm/amd/amdgpu/amdgpu_uvd: Fix forgotten unmap buffer object
after the buffer object is successfully mapped, call amdgpu_bo_kunmap before the function returns.
Signed-off-by: zhanglianjie <zhanglianjie@...ontech.com>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index 6f8de11a17f1..9cc23b220537 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -834,6 +834,7 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
handle = msg[2];
if (handle == 0) {
+ amdgpu_bo_kunmap(bo);
DRM_ERROR("Invalid UVD handle!\n");
return -EINVAL;
}
@@ -892,6 +893,7 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,
DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
}
+ amdgpu_bo_kunmap(bo);
return -EINVAL;
}
--
2.20.1
Powered by blists - more mailing lists