linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 13/14] mm: mempolicy: Check return code of check_range
@ 2010-09-05 18:33 Kulikov Vasiliy
  2010-09-05 22:04 ` David Rientjes
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kulikov Vasiliy @ 2010-09-05 18:33 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Vasiliy Kulikov, Andrew Morton, KOSAKI Motohiro, Lee Schermerhorn,
	Christoph Lameter, David Rientjes, linux-kernel, linux-mm

From: Vasiliy Kulikov <segooon@gmail.com>

Function check_range may return ERR_PTR(...). Check for it.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
 Compile tested.

 mm/mempolicy.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index f969da5..b73f02c 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -924,12 +924,15 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
 	nodemask_t nmask;
 	LIST_HEAD(pagelist);
 	int err = 0;
+	struct vm_area_struct *vma;
 
 	nodes_clear(nmask);
 	node_set(source, nmask);
 
-	check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask,
+	vma = check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask,
 			flags | MPOL_MF_DISCONTIG_OK, &pagelist);
+	if (IS_ERR(vma))
+		return PTR_ERR(vma);
 
 	if (!list_empty(&pagelist))
 		err = migrate_pages(&pagelist, new_node_page, dest, 0);
-- 
1.7.0.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2010-09-07  2:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-05 18:33 [PATCH 13/14] mm: mempolicy: Check return code of check_range Kulikov Vasiliy
2010-09-05 22:04 ` David Rientjes
2010-09-05 23:15 ` Christoph Lameter
2010-09-06  0:41 ` KOSAKI Motohiro
2010-09-06  9:02   ` David Rientjes
2010-09-06 14:18     ` Kulikov Vasiliy
2010-09-07  0:02     ` KOSAKI Motohiro
2010-09-07  1:59   ` Christoph Lameter
2010-09-07  2:04     ` KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).