From: changzhu <changfeng....@amd.com>

From: Changfeng <changfeng....@amd.com>

It's better to use kzalloc other than kmalloc to avoid unforeseen
consequences.

Change-Id: I3a73d3f943f4409e6bfbadb0237db3f649d831e9
Signed-off-by: Changfeng <changfeng....@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 5be125f3b92a..a03398c87344 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -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;
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to