drm/amdgpu: modify kmalloc to kzalloc in amdgpu_ctx_init_entity
Subsystems (2)
PATCH 1/1 drm/amdgpu: modify kmalloc to kzalloc in amdgpu_ctx_init_entity
From: changzhu <[email protected]>
From: Changfeng <[email protected]>
It's better to use kzalloc other than kmalloc to avoid unforeseen consequences.
Change-Id I3a73d3f943f4409e6bfbadb0237db3f649d831e9
Signed-off-by Changfeng <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +1 -1
@@ -100,7 +100,7 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,enum drm_sched_priority priority;int r; - entity =kmalloc (struct_size (entity, fences, amdgpu_sched_jobs), + entity =kzalloc (struct_size (entity, fences, amdgpu_sched_jobs),GFP_KERNEL );if (!entity)return -ENOMEM ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 09.10.20 um 11:04 schrieb Changfeng:
Quoted 9 lines
From: changzhu <[email protected]>
From: Changfeng <[email protected]>
It's better to use kzalloc other than kmalloc to avoid unforeseen consequences.
Change-Id I3a73d3f943f4409e6bfbadb0237db3f649d831e9Signed-off-by Changfeng <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip, · line 106
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +1
-1@@ -100,7 +100,7 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,enum drm_sched_priority priority;int r; - entity =kmalloc (struct_size (entity, fences, amdgpu_sched_jobs), + entity =kzalloc (struct_size (entity, fences, amdgpu_sched_jobs),GFP_KERNEL );if (!entity)return -ENOMEM ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx