• M
    [PATCH] SPARSEMEM incorrectly calculates section number · 12783b00
    Mike Kravetz 提交于
    A bad calculation/loop in __section_nr() could result in incorrect section
    information being put into sysfs memory entries.  This primarily impacts
    memory add operations as the sysfs information is used while onlining new
    memory.
    
    Fix suggested by Dave Hansen.
    
    Note that the bug may not be obvious from the patch.  It actually occurs in
    the function's return statement:
    
    	return (root_nr * SECTIONS_PER_ROOT) + (ms - root);
    
    In the existing code, root_nr has already been multiplied by
    SECTIONS_PER_ROOT.
    Signed-off-by: NMike Kravetz <kravetz@us.ibm.com>
    Cc: Dave Hansen <haveblue@us.ibm.com>
    Cc: Andy Whitcroft <apw@shadowen.org>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    12783b00
sparse.c 6.7 KB