Merge tag 'libnvdimm-for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdim...
[linux-2.6-block.git] / mm / hmm.c
index 320fdc87f064364a4f8d2835cf430a1c3be58915..320545b98ff55997029476f32e09dbf5d4f5f009 100644 (file)
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -418,7 +418,7 @@ again:
                }
 
                if (!pte_present(pte)) {
-                       swp_entry_t entry;
+                       swp_entry_t entry = pte_to_swp_entry(pte);
 
                        if (!non_swap_entry(entry)) {
                                if (hmm_vma_walk->fault)
@@ -426,8 +426,6 @@ again:
                                continue;
                        }
 
-                       entry = pte_to_swp_entry(pte);
-
                        /*
                         * This is a special swap entry, ignore migration, use
                         * device and report anything else as error.