diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 0dfed9d7b273f25bb54e15b82d643b19b15bf2a4..3f98fa2ac6cf591af7c0ef9e3bf359dac9e78ce6 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1860,8 +1860,10 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb if (hwpoison_filter(p)) { hugetlb_clear_page_hwpoison(head); - res = -EOPNOTSUPP; - goto out; + unlock_page(head); + if (res == 1) + put_page(head); + return -EOPNOTSUPP; } /*