diff --git a/mm/memory-failure.c b/mm/memory-failure.c index a7b8ccd29b6f52..fff849daceba94 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2578,6 +2578,13 @@ int unpoison_memory(unsigned long pfn) goto unlock_mutex; } + if (PagePoisoned(p)) { + unpoison_pr_info("%#lx: page is uninitialized\n", + pfn, &unpoison_rs); + ret = -EOPNOTSUPP; + goto unlock_mutex; + } + if (!PageHWPoison(p)) { unpoison_pr_info("%#lx: page was already unpoisoned\n", pfn, &unpoison_rs);