Skip to content

Commit 2a48b59

Browse files
Changfengalexdeucher
authored andcommitted
drm/amdgpu: switch kzalloc to kvzalloc in amdgpu_bo_create
It will cause error when alloc memory larger than 128KB in amdgpu_bo_create->kzalloc. So it needs to switch kzalloc to kvzalloc. Call Trace: alloc_pages_current+0x6a/0xe0 kmalloc_order+0x32/0xb0 kmalloc_order_trace+0x1e/0x80 __kmalloc+0x249/0x2d0 amdgpu_bo_create+0x102/0x500 [amdgpu] ? xas_create+0x264/0x3e0 amdgpu_bo_create_vm+0x32/0x60 [amdgpu] amdgpu_vm_pt_create+0xf5/0x260 [amdgpu] amdgpu_vm_init+0x1fd/0x4d0 [amdgpu] Signed-off-by: Changfeng <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 614124b commit 2a48b59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo)
100100
kfree(ubo->metadata);
101101
}
102102

103-
kfree(bo);
103+
kvfree(bo);
104104
}
105105

106106
/**
@@ -552,7 +552,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
552552
BUG_ON(bp->bo_ptr_size < sizeof(struct amdgpu_bo));
553553

554554
*bo_ptr = NULL;
555-
bo = kzalloc(bp->bo_ptr_size, GFP_KERNEL);
555+
bo = kvzalloc(bp->bo_ptr_size, GFP_KERNEL);
556556
if (bo == NULL)
557557
return -ENOMEM;
558558
drm_gem_private_object_init(adev_to_drm(adev), &bo->tbo.base, size);

0 commit comments

Comments
 (0)