]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: remap_file_pages: initialize populate before usage
authorSasha Levin <sasha.levin@oracle.com>
Sat, 17 May 2014 13:19:30 +0000 (23:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 20 May 2014 08:14:15 +0000 (18:14 +1000)
'populate' wasn't initialized before being used in error paths,
causing panics when mm_populate() would get called with invalid
values.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mmap.c

index 84dcfc72afd5db87f6f63938d5dc8fe54af286fb..2a0e0a8337b60c6299a1e3a0d7d5a37a57fffe2b 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2591,7 +2591,7 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
 
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
-       unsigned long populate;
+       unsigned long populate = 0;
        unsigned long ret = -EINVAL;
 
        pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. "