[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21236776-232e-4653-8bd0-8a2dcc6fe63c@lucifer.local>
Date: Thu, 23 Mar 2023 12:03:44 +0000
From: Lorenzo Stoakes <lstoakes@...il.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Tom Rix <trix@...hat.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Suren Baghdasaryan <surenb@...gle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH 1/3] mm/mmap/vma_merge: actually set next to NULL if not
applicable
On Thu, Mar 23, 2023 at 12:58:34PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> As clang builds point out, the variable 'next' is now uninitialized
> in some conditions as a result of a previous patch that tried to
> rely on it being NULL here:
>
> mm/mmap.c:939:11: error: variable 'next' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> else if (!curr)
> ^~~~~
> mm/mmap.c:952:15: note: uninitialized use occurs here
> merge_next = next && mpol_equal(policy, vma_policy(next)) &&
> ^~~~
>
> Fixes: e887ecae997e ("mm/mmap/vma_merge: set next to NULL if not applicable")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> mm/mmap.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 54099a604cf8..c01d43bd694e 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -939,6 +939,8 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm,
> else if (!curr)
> /* Is there a VMA next to a hole (case 1 - 3) or prev (4)? */
> next = vma_lookup(mm, end);
> + else
> + next = NULL;
>
> /* Can we merge the predecessor? */
> if (prev && addr == prev->vm_end && mpol_equal(vma_policy(prev), policy)
> --
> 2.39.2
>
This was already fixed in a more recent series of this patch set (at
v3). Sorry for this reaching -next!
See https://lore.kernel.org/all/cover.1679516210.git.lstoakes@gmail.com/
Powered by blists - more mailing lists