OSDN Git Service

dt-bindings: display: mediatek: Fix examples on new bindings
[uclinux-h8/linux.git] / mm / hwpoison-inject.c
index aff4d27..bb0cea5 100644 (file)
@@ -32,9 +32,9 @@ static int hwpoison_inject(void *data, u64 val)
 
        shake_page(hpage);
        /*
-        * This implies unable to support non-LRU pages.
+        * This implies unable to support non-LRU pages except free page.
         */
-       if (!PageLRU(hpage) && !PageHuge(p))
+       if (!PageLRU(hpage) && !PageHuge(p) && !is_free_buddy_page(p))
                return 0;
 
        /*
@@ -48,7 +48,8 @@ static int hwpoison_inject(void *data, u64 val)
 
 inject:
        pr_info("Injecting memory failure at pfn %#lx\n", pfn);
-       return memory_failure(pfn, 0);
+       err = memory_failure(pfn, 0);
+       return (err == -EOPNOTSUPP) ? 0 : err;
 }
 
 static int hwpoison_unpoison(void *data, u64 val)