drm/amd/amdgpu: Avoid fault when allocating an empty buffer object
authorTom St Denis <[email protected]>
Mon, 17 Sep 2018 18:07:00 +0000 (14:07 -0400)
committerAlex Deucher <[email protected]>
Wed, 19 Sep 2018 17:37:04 +0000 (12:37 -0500)
Signed-off-by: Tom St Denis <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index 84d82d5382f95b39934c94dd37098bc9075afa13..c1387efc0c91b8ddc3dfac4d69bc74c5541c14e6 100644 (file)
@@ -348,7 +348,8 @@ int amdgpu_bo_create_kernel(struct amdgpu_device *adev,
        if (r)
                return r;
 
-       amdgpu_bo_unreserve(*bo_ptr);
+       if (*bo_ptr)
+               amdgpu_bo_unreserve(*bo_ptr);
 
        return 0;
 }