drm/amd/amdgpu: Avoid fault when allocating an empty buffer object

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Tom St Denis 2018-09-17 14:07:00 -04:00 committed by Alex Deucher
parent 5297572806
commit ddaf501347

View 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;
}