mm/hwpoison: fix failure to split thp w/ refcount held
[firefly-linux-kernel-4.4.55.git] / mm / memory-failure.c
index 016c814101edbacd286b8c9aaa2cd8f43532f371..8ad923a93539b4ac99e65cf507cab377388b618c 100644 (file)
@@ -1725,6 +1725,8 @@ int soft_offline_page(struct page *page, int flags)
                if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) {
                        pr_info("soft offline: %#lx: failed to split THP\n",
                                pfn);
+                       if (flags & MF_COUNT_INCREASED)
+                               put_page(page);
                        return -EBUSY;
                }
        }