mm: Convert vmalloc/memset to vzalloc
authorJoe Perches <joe@perches.com>
Sat, 28 May 2011 17:36:34 +0000 (10:36 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 15 Sep 2011 11:56:56 +0000 (13:56 +0200)
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Paul Menage <menage@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
mm/page_cgroup.c

index 39d216d535eaed26ff926dbf403de24d744e69a6..6bdc67dbbc28920c36d0511057071d7229f58e39 100644 (file)
@@ -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;