diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index e6909252aefa..84d82d5382f9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -250,6 +250,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev, | |||
250 | bool free = false; | 250 | bool free = false; |
251 | int r; | 251 | int r; |
252 | 252 | ||
253 | if (!size) { | ||
254 | amdgpu_bo_unref(bo_ptr); | ||
255 | return 0; | ||
256 | } | ||
257 | |||
253 | memset(&bp, 0, sizeof(bp)); | 258 | memset(&bp, 0, sizeof(bp)); |
254 | bp.size = size; | 259 | bp.size = size; |
255 | bp.byte_align = align; | 260 | bp.byte_align = align; |