Skip to content
  • Andrew Morton's avatar
    [PATCH] msync: fix return value · 676758bd
    Andrew Morton authored
    
    
    msync() does a strange thing.  Essentially:
    
    	vma = find_vma();
    	for ( ; ; ) {
    		if (!vma)
    			return -ENOMEM;
    		...
    		vma = vma->vm_next;
    	}
    
    so an msync() request which starts within or before a valid VMA and which ends
    within or beyond the final VMA will incorrectly return -ENOMEM.
    
    Fix.
    
    Cc: Hugh Dickins <hugh@veritas.com>
    Cc: Nick Piggin <nickpiggin@yahoo.com.au>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    676758bd