From: Alex Deucher Date: Tue, 28 Jul 2020 21:38:29 +0000 (-0400) Subject: drm/amdgpu: handle bo size 0 in amdgpu_bo_create_kernel_at (v2) X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=37912e963dadcc831dd2a766780ff0b8738773d8;p=linux.git drm/amdgpu: handle bo size 0 in amdgpu_bo_create_kernel_at (v2) Just return early to match other bo_create functions. v2: check if the bo_ptr is NULL rather than checking the size. Reviewed-by: Christian König Reviewed-by: Felix Kuehling (v1) Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 5ac7b55614750..a3cf38d25fc15 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -374,6 +374,9 @@ int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev, if (r) return r; + if ((*bo_ptr) == NULL) + return 0; + /* * Remove the original mem node and create a new one at the request * position.