summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 5c344665b43c..1eb2e89fcdeb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -212,8 +212,7 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
int32_t ctx_prio;
int r;
- entity = kzalloc(struct_size(entity, fences, amdgpu_sched_jobs),
- GFP_KERNEL);
+ entity = kzalloc_flex(*entity, fences, amdgpu_sched_jobs, GFP_KERNEL);
if (!entity)
return -ENOMEM;
@@ -483,7 +482,7 @@ static int amdgpu_ctx_alloc(struct amdgpu_device *adev,
struct amdgpu_ctx *ctx;
int r;
- ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
+ ctx = kmalloc_obj(*ctx, GFP_KERNEL);
if (!ctx)
return -ENOMEM;