Skip to content

Commit

Permalink
mm: Convert vmalloc/memset to vzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Joe Perches authored and Jiri Kosina committed Sep 15, 2011
1 parent 558feb0 commit 8c1fec1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/page_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,10 @@ int swap_cgroup_swapon(int type, unsigned long max_pages)
length = DIV_ROUND_UP(max_pages, SC_PER_PAGE);
array_size = length * sizeof(void *);

array = vmalloc(array_size);
array = vzalloc(array_size);
if (!array)
goto nomem;

memset(array, 0, array_size);
ctrl = &swap_cgroup_ctrl[type];
mutex_lock(&swap_cgroup_mutex);
ctrl->length = length;
Expand Down

0 comments on commit 8c1fec1

Please sign in to comment.