aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 6d6d28c0a72f..99eb5048b7a8 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2047,13 +2047,12 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
2047 goto bad_swap; 2047 goto bad_swap;
2048 2048
2049 /* OK, set up the swap map and apply the bad block list */ 2049 /* OK, set up the swap map and apply the bad block list */
2050 swap_map = vmalloc(maxpages); 2050 swap_map = vzalloc(maxpages);
2051 if (!swap_map) { 2051 if (!swap_map) {
2052 error = -ENOMEM; 2052 error = -ENOMEM;
2053 goto bad_swap; 2053 goto bad_swap;
2054 } 2054 }
2055 2055
2056 memset(swap_map, 0, maxpages);
2057 nr_good_pages = maxpages - 1; /* omit header page */ 2056 nr_good_pages = maxpages - 1; /* omit header page */
2058 2057
2059 for (i = 0; i < swap_header->info.nr_badpages; i++) { 2058 for (i = 0; i < swap_header->info.nr_badpages; i++) {