diff --git a/mm/rmap.c b/mm/rmap.c index ad509b3a89ee..91a63dc636ad 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1681,6 +1681,7 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma, break; } if (arch_unmap_one(mm, vma, address, pteval) < 0) { + swap_free(entry); set_pte_at(mm, address, pvmw.pte, pteval); ret = false; page_vma_mapped_walk_done(&pvmw);