]> Git Repo - linux.git/commitdiff
drm/amdgpu: don't allocate zero sized kernel BOs
authorChristian König <[email protected]>
Fri, 14 Sep 2018 19:03:37 +0000 (21:03 +0200)
committerAlex Deucher <[email protected]>
Wed, 19 Sep 2018 17:36:50 +0000 (12:36 -0500)
Just free the BO if the size should be zero.

Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

index e6909252aefabec5594cc92eaa2cc7f5acade34e..84d82d5382f95b39934c94dd37098bc9075afa13 100644 (file)
@@ -250,6 +250,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
        bool free = false;
        int r;
 
+       if (!size) {
+               amdgpu_bo_unref(bo_ptr);
+               return 0;
+       }
+
        memset(&bp, 0, sizeof(bp));
        bp.size = size;
        bp.byte_align = align;
This page took 0.051615 seconds and 4 git commands to generate.