summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mm/huge_memory.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index a94c07a1b3c5..1e21b4cf4c75 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2306,11 +2306,8 @@ static void khugepaged_wait_work(void)
static void khugepaged_loop(void)
{
- struct page *hpage;
+ struct page *hpage = NULL;
-#ifdef CONFIG_NUMA
- hpage = NULL;
-#endif
while (likely(khugepaged_enabled())) {
#ifndef CONFIG_NUMA
hpage = khugepaged_alloc_hugepage();
@@ -2324,10 +2321,9 @@ static void khugepaged_loop(void)
#endif
khugepaged_do_scan(&hpage);
-#ifndef CONFIG_NUMA
- if (hpage)
+
+ if (!IS_ERR_OR_NULL(hpage))
put_page(hpage);
-#endif
khugepaged_wait_work();
}