]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: remap_file_pages: initialize populate before usage
authorSasha Levin <sasha.levin@oracle.com>
Thu, 22 May 2014 00:54:39 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 10 Jun 2014 06:02:12 +0000 (16:02 +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 9a1e165e9daf662834a400457178644286508f5f..1a491fc96436ac94aac85812ee27f4fec40a57a1 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. "