Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorri...
[linux] / net / sctp / protocol.c
index 9b277bd..d5878ae 100644 (file)
@@ -1368,6 +1368,7 @@ static __init int sctp_init(void)
        int status = -EINVAL;
        unsigned long goal;
        unsigned long limit;
+       unsigned long nr_pages = totalram_pages();
        int max_share;
        int order;
        int num_entries;
@@ -1426,10 +1427,10 @@ static __init int sctp_init(void)
         * The methodology is similar to that of the tcp hash tables.
         * Though not identical.  Start by getting a goal size
         */
-       if (totalram_pages >= (128 * 1024))
-               goal = totalram_pages >> (22 - PAGE_SHIFT);
+       if (nr_pages >= (128 * 1024))
+               goal = nr_pages >> (22 - PAGE_SHIFT);
        else
-               goal = totalram_pages >> (24 - PAGE_SHIFT);
+               goal = nr_pages >> (24 - PAGE_SHIFT);
 
        /* Then compute the page order for said goal */
        order = get_order(goal);