From 8c944335a3a7acaa23ce710b973927476997592a Mon Sep 17 00:00:00 2001 From: Liujie Xie Date: Wed, 26 May 2021 10:31:17 +0800 Subject: [PATCH] ANDROID: Fix access invalid addr because it is not initialized The addr is not initialized, we may access a random value. Fixes: dc5241048fe9229 ("ANDROID: vendor_hooks: Add hooks for reducing virtual address fragmentation") Bug: 187259935 Signed-off-by: Liujie Xie Change-Id: I770bf5e69e6fcd4e1ccd3987b4891156892de758 --- mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mmap.c b/mm/mmap.c index 9e95b894190a..fbebd65565ce 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2094,7 +2094,7 @@ static unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info) struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned long length, low_limit, high_limit, gap_start, gap_end; - unsigned long addr; + unsigned long addr = 0; /* Adjust search length to account for worst case alignment overhead */ length = info->length + info->align_mask;