lkml.org 
[lkml]   [2019]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched: Use kmem_cache_zalloc() instead of kmem_cache_alloc() with flag GFP_ZERO.
Date
From: Huang Zijiang <huang.zijiang@zte.com.cn>

Use kmem_cache_zalloc instead of manually setting kmem_cache_alloc
with flag GFP_ZERO since kzalloc sets allocated memory
to zero.

Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f2b111b..981ee92 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6939,7 +6939,7 @@ struct task_group *sched_create_group(struct task_group *parent)
{
struct task_group *tg;

- tg = kmem_cache_alloc(task_group_cache, GFP_KERNEL | __GFP_ZERO);
+tg = kmem_cache_zalloc(task_group_cache, GFP_KERNEL);
if (!tg)
return ERR_PTR(-ENOMEM);

--
1.9.1
\
 
 \ /
  Last update: 2019-12-23 02:56    [W:0.046 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site