summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/zswap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/zswap.c b/mm/zswap.c
index 7ec8bd912d13..55094e63b72d 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -1359,7 +1359,8 @@ static int __init init_zswap(void)
return 0;
fallback_fail:
- zswap_pool_destroy(pool);
+ if (pool)
+ zswap_pool_destroy(pool);
hp_fail:
cpuhp_remove_state(CPUHP_MM_ZSWP_MEM_PREPARE);
dstmem_fail: