Skip to contentSkip to conversation

mm: cma: alloc_contig_range: return early for err path

PATCH In review Bob Liu 3 participants 3 messages Oct 23, 2012

Subsystems (2)
lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH 1/1 mm: cma: alloc_contig_range: return early for err path

If start_isolate_page_range() failed, unset_migratetype_isolate() has been done inside it.

---
 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
index bb90971..b0012ab 100644
@@ -5825,7 +5825,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
 	ret = start_isolate_page_range(pfn_max_align_down(start),
 				       pfn_max_align_up(end), migratetype);
 	if (ret)
-		goto done;
+		return ret;
 
 	ret = __alloc_contig_migrate_range(&cc, start, end);
 	if (ret)
Signature · 8 lines
1.7.9.5


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#1 lore raw
Quoted 13 lines · Bob Liu

If start_isolate_page_range() failed, unset_migratetype_isolate() has been done inside it.

---
  mm/page_alloc.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +0 -0
index bb90971..b0012ab 100644

mm/page_alloc.c int alloc_contig_range(unsigned long start, unsigned long end, · line 5828

Quoted 5 lines
mm/page_alloc.c +1 -1
@@ -5825,7 +5825,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
  	ret = start_isolate_page_range(pfn_max_align_down(start),
  				       pfn_max_align_up(end), migratetype);
  	if (ret)
-		goto done;
+		return ret;

looks reasonable to me.

mm/page_alloc.c int alloc_contig_range(unsigned long start, unsigned long end, · line 5831

Quoted 3 lines
mm/page_alloc.c +0 -0
  	ret = __alloc_contig_migrate_range(&cc, start, end);
  	if (ret)

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

#2 lore raw
In reply to Bob Liu

Hello,

Quoted 14 lines · Bob Liu

If start_isolate_page_range() failed, unset_migratetype_isolate() has been done inside it.

---
  mm/page_alloc.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +0 -0
index bb90971..b0012ab 100644

mm/page_alloc.c int alloc_contig_range(unsigned long start, unsigned long end, · line 5831

Quoted 8 lines
mm/page_alloc.c +1 -1
@@ -5825,7 +5825,7 @@ int alloc_contig_range(unsigned long start, unsigned long end,
  	ret = start_isolate_page_range(pfn_max_align_down(start),
  				       pfn_max_align_up(end), migratetype);
  	if (ret)
-		goto done;
+		return ret;
 
  	ret = __alloc_contig_migrate_range(&cc, start, end);
  	if (ret)

Thanks for the fix, I've applied it to my kernel tree.

Best regards

Signature · 8 lines
Marek Szyprowski
Samsung Poland R&D Center

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