Thread (26 messages) 26 messages, 4 authors, 2012-06-27

Re: [PATCH 4/5] mm/sparse: more check on mem_section number

From: Dave Hansen <hidden>
Date: 2012-06-26 16:45:09

On 06/23/2012 08:52 AM, Gavin Shan wrote:
quoted hunk ↗ jump to hunk
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -160,6 +160,8 @@ int __section_nr(struct mem_section* ms)
 		     break;
 	}

+	VM_BUG_ON(root_nr == NR_SECTION_ROOTS);
+
 	return (root_nr * SECTIONS_PER_ROOT) + (ms - root);
 }
If you're going to bother with a VM_BUG_ON(), I'd probably make it:

	VM_BUG_ON(root_nr >= NR_SECTION_ROOTS);

--
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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help