mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/amdgpu/amdgpu_uvd: Fix forgotten unmap buffer object
@ 2022-01-29  7:35 zhanglianjie
  2022-01-29  7:35 ` [PATCH 2/2] drm/radeon/uvd: Fix forgotten unmap buffer objects zhanglianjie
  0 siblings, 1 reply; 3+ messages in thread
From: zhanglianjie @ 2022-01-29  7:35 UTC (permalink / raw)
  To: Alex Deucher
  Cc: linux-kernel, dri-devel, amd-gfx, Daniel Vetter, David Airlie,
	Pan, Xinhui, Christian König, zhanglianjie

after the buffer object is successfully mapped, call amdgpu_bo_kunmap before the function returns.

Signed-off-by: zhanglianjie <zhanglianjie@uniontech.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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-30  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29  7:35 [PATCH 1/2] drm/amd/amdgpu/amdgpu_uvd: Fix forgotten unmap buffer object zhanglianjie
2022-01-29  7:35 ` [PATCH 2/2] drm/radeon/uvd: Fix forgotten unmap buffer objects zhanglianjie
2022-01-30  8:56   ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®