summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2020-07-28 17:38:29 -0400
committerAlex Deucher <alexander.deucher@amd.com>2020-08-04 17:29:28 -0400
commit37912e963dadcc831dd2a766780ff0b8738773d8 (patch)
treedad2035ffcb7f747b821fab8f08706704c58dc52 /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parent66f3db4ba62db74d0f6c5a0f872592f1a0ed7670 (diff)
downloadlinux-stable-37912e963dadcc831dd2a766780ff0b8738773d8.tar.gz
linux-stable-37912e963dadcc831dd2a766780ff0b8738773d8.tar.bz2
linux-stable-37912e963dadcc831dd2a766780ff0b8738773d8.zip
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 <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> (v1) Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 5ac7b5561475..a3cf38d25fc1 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.