mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 07:21:27 +00:00
mm: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Paul Menage <menage@google.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
558feb0818
commit
8c1fec1ba8
1 changed files with 1 additions and 2 deletions
|
@ -513,11 +513,10 @@ int swap_cgroup_swapon(int type, unsigned long max_pages)
|
||||||
length = DIV_ROUND_UP(max_pages, SC_PER_PAGE);
|
length = DIV_ROUND_UP(max_pages, SC_PER_PAGE);
|
||||||
array_size = length * sizeof(void *);
|
array_size = length * sizeof(void *);
|
||||||
|
|
||||||
array = vmalloc(array_size);
|
array = vzalloc(array_size);
|
||||||
if (!array)
|
if (!array)
|
||||||
goto nomem;
|
goto nomem;
|
||||||
|
|
||||||
memset(array, 0, array_size);
|
|
||||||
ctrl = &swap_cgroup_ctrl[type];
|
ctrl = &swap_cgroup_ctrl[type];
|
||||||
mutex_lock(&swap_cgroup_mutex);
|
mutex_lock(&swap_cgroup_mutex);
|
||||||
ctrl->length = length;
|
ctrl->length = length;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue