Commit 21a7e77f authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: don't allocate zero sized kernel BOs

Just free the BO if the size should be zero.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 3b2de699
...@@ -250,6 +250,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev, ...@@ -250,6 +250,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
bool free = false; bool free = false;
int r; int r;
if (!size) {
amdgpu_bo_unref(bo_ptr);
return 0;
}
memset(&bp, 0, sizeof(bp)); memset(&bp, 0, sizeof(bp));
bp.size = size; bp.size = size;
bp.byte_align = align; bp.byte_align = align;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment