public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: fix do_mbind return value
@ 2015-03-05  2:20 Kazutomo Yoshii
  2015-03-05  6:53 ` David Rientjes
  0 siblings, 1 reply; 7+ messages in thread
From: Kazutomo Yoshii @ 2015-03-05  2:20 UTC (permalink / raw)
  To: linux-kernel

I noticed that numa_alloc_onnode() failed to allocate memory on a
specified node in v4.0-rc1. I added a code to check the return value
of walk_page_range() in queue_pages_range() so that do_mbind() only
returns an error number or zero.

Signed-off-by: Kazutomo Yoshii <kazutomo.yoshii@gmail.com>
---
 mm/mempolicy.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 4721046..ea79171 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -644,6 +644,7 @@ queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end,
 		.nmask = nodes,
 		.prev = NULL,
 	};
+	int err;
 	struct mm_walk queue_pages_walk = {
 		.hugetlb_entry = queue_pages_hugetlb,
 		.pmd_entry = queue_pages_pte_range,
@@ -652,7 +653,10 @@ queue_pages_range(struct mm_struct *mm, unsigned long start, unsigned long end,
 		.private = &qp,
 	};
 -	return walk_page_range(start, end, &queue_pages_walk);
+	err = walk_page_range(start, end, &queue_pages_walk);
+	if (err < 0)
+		return err;
+	return 0;
 }
  /*
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-05 20:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05  2:20 [PATCH] mm: fix do_mbind return value Kazutomo Yoshii
2015-03-05  6:53 ` David Rientjes
2015-03-05  7:44   ` Kazutomo Yoshii
2015-03-05  8:02   ` [PATCH] mm: pagewalk: prevent positive return value of walk_page_test() from being passed to callers (Re: [PATCH] mm: fix do_mbind return value) Naoya Horiguchi
2015-03-05  8:09     ` Naoya Horiguchi
2015-03-05  8:27       ` Naoya Horiguchi
2015-03-05 20:34     ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox