[PATCH 2/2] drm/amdgpu: fix size calc error in bo_create_kernel_at

Zhou1, Tao Tao.Zhou1 at amd.com
Tue Sep 17 06:17:01 UTC 2019


replace offset with size

Signed-off-by: Tao Zhou <tao.zhou1 at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index ecad84e1b4e2..2fcd2d14cbf0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -366,7 +366,7 @@ int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev,
 	int r;
 
 	offset &= PAGE_MASK;
-	size = ALIGN(offset, PAGE_SIZE);
+	size = ALIGN(size, PAGE_SIZE);
 
 	r = amdgpu_bo_create_reserved(adev, size, PAGE_SIZE, domain, bo_ptr,
 				      NULL, NULL);
-- 
2.17.1



More information about the amd-gfx mailing list