diff options
-rw-r--r-- | mm/slab.c | 3 | ||||
-rw-r--r-- | mm/swapfile.c | 12 |
2 files changed, 8 insertions, 7 deletions
@@ -854,7 +854,6 @@ static int __devinit cpuup_callback(struct notifier_block *nfb, | |||
854 | struct kmem_list3 *l3 = NULL; | 854 | struct kmem_list3 *l3 = NULL; |
855 | int node = cpu_to_node(cpu); | 855 | int node = cpu_to_node(cpu); |
856 | int memsize = sizeof(struct kmem_list3); | 856 | int memsize = sizeof(struct kmem_list3); |
857 | struct array_cache *nc = NULL; | ||
858 | 857 | ||
859 | switch (action) { | 858 | switch (action) { |
860 | case CPU_UP_PREPARE: | 859 | case CPU_UP_PREPARE: |
@@ -891,6 +890,8 @@ static int __devinit cpuup_callback(struct notifier_block *nfb, | |||
891 | /* Now we can go ahead with allocating the shared array's | 890 | /* Now we can go ahead with allocating the shared array's |
892 | & array cache's */ | 891 | & array cache's */ |
893 | list_for_each_entry(cachep, &cache_chain, next) { | 892 | list_for_each_entry(cachep, &cache_chain, next) { |
893 | struct array_cache *nc; | ||
894 | |||
894 | nc = alloc_arraycache(node, cachep->limit, | 895 | nc = alloc_arraycache(node, cachep->limit, |
895 | cachep->batchcount); | 896 | cachep->batchcount); |
896 | if (!nc) | 897 | if (!nc) |
diff --git a/mm/swapfile.c b/mm/swapfile.c index 6da4b28b896b..80f948a2028b 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -1493,7 +1493,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) | |||
1493 | goto bad_swap; | 1493 | goto bad_swap; |
1494 | if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES) | 1494 | if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES) |
1495 | goto bad_swap; | 1495 | goto bad_swap; |
1496 | 1496 | ||
1497 | /* OK, set up the swap map and apply the bad block list */ | 1497 | /* OK, set up the swap map and apply the bad block list */ |
1498 | if (!(p->swap_map = vmalloc(maxpages * sizeof(short)))) { | 1498 | if (!(p->swap_map = vmalloc(maxpages * sizeof(short)))) { |
1499 | error = -ENOMEM; | 1499 | error = -ENOMEM; |
@@ -1502,17 +1502,17 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) | |||
1502 | 1502 | ||
1503 | error = 0; | 1503 | error = 0; |
1504 | memset(p->swap_map, 0, maxpages * sizeof(short)); | 1504 | memset(p->swap_map, 0, maxpages * sizeof(short)); |
1505 | for (i=0; i<swap_header->info.nr_badpages; i++) { | 1505 | for (i = 0; i < swap_header->info.nr_badpages; i++) { |
1506 | int page = swap_header->info.badpages[i]; | 1506 | int page_nr = swap_header->info.badpages[i]; |
1507 | if (page <= 0 || page >= swap_header->info.last_page) | 1507 | if (page_nr <= 0 || page_nr >= swap_header->info.last_page) |
1508 | error = -EINVAL; | 1508 | error = -EINVAL; |
1509 | else | 1509 | else |
1510 | p->swap_map[page] = SWAP_MAP_BAD; | 1510 | p->swap_map[page_nr] = SWAP_MAP_BAD; |
1511 | } | 1511 | } |
1512 | nr_good_pages = swap_header->info.last_page - | 1512 | nr_good_pages = swap_header->info.last_page - |
1513 | swap_header->info.nr_badpages - | 1513 | swap_header->info.nr_badpages - |
1514 | 1 /* header page */; | 1514 | 1 /* header page */; |
1515 | if (error) | 1515 | if (error) |
1516 | goto bad_swap; | 1516 | goto bad_swap; |
1517 | } | 1517 | } |
1518 | 1518 | ||