OSDN Git Service

drm/amdgpu: handle bo size 0 in amdgpu_bo_create_kernel_at (v2)
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Jul 2020 21:38:29 +0000 (17:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 4 Aug 2020 21:29:28 +0000 (17:29 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index 5ac7b55..a3cf38d 100644 (file)
@@ -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.