mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
fs: use kmem_cache_zalloc instead
Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
87400c0475
commit
4975e45ff6
@ -102,12 +102,11 @@ struct file *get_empty_filp(void)
|
||||
goto over;
|
||||
}
|
||||
|
||||
f = kmem_cache_alloc(filp_cachep, GFP_KERNEL);
|
||||
f = kmem_cache_zalloc(filp_cachep, GFP_KERNEL);
|
||||
if (f == NULL)
|
||||
goto fail;
|
||||
|
||||
percpu_counter_inc(&nr_files);
|
||||
memset(f, 0, sizeof(*f));
|
||||
if (security_file_alloc(f))
|
||||
goto fail_sec;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user