[PATCH] drm/amdgpu: modify kmalloc to kzalloc in amdgpu_ctx_init_entity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: changzhu <Changfeng.Zhu@xxxxxxx>

From: Changfeng <Changfeng.Zhu@xxxxxxx>

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

Change-Id: I3a73d3f943f4409e6bfbadb0237db3f649d831e9
Signed-off-by: Changfeng <Changfeng.Zhu@xxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux