summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/page_cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 4eb05302e2e1..5524e8bd7437 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -475,7 +475,7 @@ int swap_cgroup_swapon(int type, unsigned long max_pages)
if (!do_swap_account)
return 0;
- length = ((max_pages/SC_PER_PAGE) + 1);
+ length = DIV_ROUND_UP(max_pages, SC_PER_PAGE);
array_size = length * sizeof(void *);
array = vmalloc(array_size);