Merge tag 'mm-stable-2024-05-17-19-19' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / arch / s390 / mm / mmap.c
index b14fc0887654d28376081f5b4c77b0751109c149..2067569465897b364530fe589f6d1a52c9d37916 100644 (file)
@@ -86,7 +86,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
 {
        struct mm_struct *mm = current->mm;
        struct vm_area_struct *vma;
-       struct vm_unmapped_area_info info;
+       struct vm_unmapped_area_info info = {};
 
        if (len > TASK_SIZE - mmap_min_addr)
                return -ENOMEM;
@@ -102,7 +102,6 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
                        goto check_asce_limit;
        }
 
-       info.flags = 0;
        info.length = len;
        info.low_limit = mm->mmap_base;
        info.high_limit = TASK_SIZE;
@@ -122,7 +121,7 @@ unsigned long arch_get_unmapped_area_topdown(struct file *filp, unsigned long ad
 {
        struct vm_area_struct *vma;
        struct mm_struct *mm = current->mm;
-       struct vm_unmapped_area_info info;
+       struct vm_unmapped_area_info info = {};
 
        /* requested length too big for entire address space */
        if (len > TASK_SIZE - mmap_min_addr)
@@ -185,10 +184,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm, struct rlimit *rlim_stack)
         */
        if (mmap_is_legacy(rlim_stack)) {
                mm->mmap_base = mmap_base_legacy(random_factor);
-               mm->get_unmapped_area = arch_get_unmapped_area;
+               clear_bit(MMF_TOPDOWN, &mm->flags);
        } else {
                mm->mmap_base = mmap_base(random_factor, rlim_stack);
-               mm->get_unmapped_area = arch_get_unmapped_area_topdown;
+               set_bit(MMF_TOPDOWN, &mm->flags);
        }
 }