aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-04 10:03:00 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-04 10:03:00 +0100
commit35ffc2a00fe3b8be8ccd9158a88595d9094a6269 (patch)
treed2e24caa0f5c84a71c2d52ac7f0f8cd2a91e77ee
parentmm: only use bdev functions for CONFIG_BLOCK (diff)
downloadrhel7-kernel-misery-master.tar.xz
rhel7-kernel-misery-master.zip
mm: do not assume generic_max_swapfile_size existsHEADmaster
For CONFIG_SWAP=n configurations, generic_max_swapfile_size is not compiled in, so conditionalize this statement. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--arch/x86/mm/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 43c77f4d4d1..b21a95b508b 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -817,7 +817,7 @@ unsigned long max_swapfile_size(void)
{
unsigned long pages;
- pages = generic_max_swapfile_size();
+ pages = IS_ENABLED(CONFIG_SWAP) ? generic_max_swapfile_size() : 0;
if (boot_cpu_has_bug(X86_BUG_L1TF)) {
/* Limit the swap file size to MAX_PA/2 for L1TF workaround */