From: Nick Piggin Date: Wed, 14 Feb 2007 11:36:32 +0000 (+0100) Subject: [PATCH] mincore: fill in results properly X-Git-Tag: v2.6.21-rc1~181 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4a76ef036ac415c28d1adbaf2b7a74040b84d4c2;p=linux-2.6-omap-h63xx.git [PATCH] mincore: fill in results properly Paper bag time. Thanks to Randy for noticing that I didn't actually assign 'present' to anything. Unfortunately my original patch passed the few simple test cases I gave it, purely by coincidence. Signed-off-by: Nick Piggin Signed-off-by: Linus Torvalds --- diff --git a/mm/mincore.c b/mm/mincore.c index 9780097e381..9c1d0a426e9 100644 --- a/mm/mincore.c +++ b/mm/mincore.c @@ -125,6 +125,8 @@ static long do_mincore(unsigned long addr, unsigned char *vec, unsigned long pag #endif } } + + vec[i] = present; } pte_unmap_unlock(ptep-1, ptl); @@ -135,6 +137,9 @@ none_mapped: pgoff = linear_page_index(vma, addr); for (i = 0; i < nr; i++, pgoff++) vec[i] = mincore_page(vma->vm_file->f_mapping, pgoff); + } else { + for (i = 0; i < nr; i++) + vec[i] = 0; } return nr;