Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
[linux] / net / netfilter / nf_conntrack_core.c
index e87c21e..741b533 100644 (file)
@@ -2248,6 +2248,7 @@ static __always_inline unsigned int total_extension_size(void)
 
 int nf_conntrack_init_start(void)
 {
+       unsigned long nr_pages = totalram_pages();
        int max_factor = 8;
        int ret = -ENOMEM;
        int i;
@@ -2267,11 +2268,11 @@ int nf_conntrack_init_start(void)
                 * >= 4GB machines have 65536 buckets.
                 */
                nf_conntrack_htable_size
-                       = (((totalram_pages << PAGE_SHIFT) / 16384)
+                       = (((nr_pages << PAGE_SHIFT) / 16384)
                           / sizeof(struct hlist_head));
-               if (totalram_pages > (4 * (1024 * 1024 * 1024 / PAGE_SIZE)))
+               if (nr_pages > (4 * (1024 * 1024 * 1024 / PAGE_SIZE)))
                        nf_conntrack_htable_size = 65536;
-               else if (totalram_pages > (1024 * 1024 * 1024 / PAGE_SIZE))
+               else if (nr_pages > (1024 * 1024 * 1024 / PAGE_SIZE))
                        nf_conntrack_htable_size = 16384;
                if (nf_conntrack_htable_size < 32)
                        nf_conntrack_htable_size = 32;