summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.com>2017-11-24 11:13:07 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-24 11:26:29 +0100
commit0208fabf7256245125fbabf03207a0da4000ea2d (patch)
tree9921888d7dd6c9250dea8101ed6df081666416d1 /mm
parent5baf0fb260fc59d632ba150f442a5904650d6170 (diff)
mm, hwpoison: fixup "mm: check the return value of lookup_page_ext for all call sites"
Backport of the upstream commit f86e4271978b ("mm: check the return value of lookup_page_ext for all call sites") is wrong for hwpoison pages. I have accidentally negated the condition for bailout. This basically disables hwpoison pages tracking while the code still might crash on unusual configurations when struct pages do not have page_ext allocated. The fix is trivial to invert the condition. Reported-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/debug-pagealloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/debug-pagealloc.c b/mm/debug-pagealloc.c
index fe1c61f7cf26..3b8f1b83610e 100644
--- a/mm/debug-pagealloc.c
+++ b/mm/debug-pagealloc.c
@@ -34,7 +34,7 @@ static inline void set_page_poison(struct page *page)
struct page_ext *page_ext;
page_ext = lookup_page_ext(page);
- if (page_ext)
+ if (!page_ext)
return;
__set_bit(PAGE_EXT_DEBUG_POISON, &page_ext->flags);
}
@@ -44,7 +44,7 @@ static inline void clear_page_poison(struct page *page)
struct page_ext *page_ext;
page_ext = lookup_page_ext(page);
- if (page_ext)
+ if (!page_ext)
return;
__clear_bit(PAGE_EXT_DEBUG_POISON, &page_ext->flags);
}
@@ -54,7 +54,7 @@ static inline bool page_poison(struct page *page)
struct page_ext *page_ext;
page_ext = lookup_page_ext(page);
- if (page_ext)
+ if (!page_ext)
return false;
return test_bit(PAGE_EXT_DEBUG_POISON, &page_ext->flags);
}