]> Git Repo - linux.git/commitdiff
mm/madvise.c: fix return value of madvise_hwpoison()
authorWanpeng Li <[email protected]>
Wed, 11 Sep 2013 21:23:02 +0000 (14:23 -0700)
committerLinus Torvalds <[email protected]>
Wed, 11 Sep 2013 22:58:12 +0000 (15:58 -0700)
The return value outside for loop is always zero which means
madvise_hwpoison return success, however, this is not truth for
soft_offline_page w/ failure return value.

Signed-off-by: Wanpeng Li <[email protected]>
Reviewed-by: Naoya Horiguchi <[email protected]>
Cc: Andi Kleen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/madvise.c

index 30293ab95b065e45ce3e3dd7b7d906f0bcf299e5..51bffa4140277f8d0420a4aa3028a7afd4799baa 100644 (file)
@@ -361,7 +361,7 @@ static int madvise_hwpoison(int bhv, unsigned long start, unsigned long end)
                                page_to_pfn(p), start);
                        ret = soft_offline_page(p, MF_COUNT_INCREASED);
                        if (ret)
-                               break;
+                               return ret;
                        continue;
                }
                pr_info("Injecting memory failure for page %#lx at %#lx\n",
This page took 0.053097 seconds and 4 git commands to generate.