Thread (6 messages) 6 messages, 4 authors, 2017-01-24

Re: [PATCH] mm: ensure alloc_flags in slow path are initialized

From: David Rientjes <rientjes@google.com>
Date: 2017-01-23 22:54:32
Also in: lkml

On Mon, 23 Jan 2017, Arnd Bergmann wrote:
The __alloc_pages_slowpath() has gotten rather complex and gcc
is no longer able to follow the gotos and prove that the
alloc_flags variable is initialized at the time it is used:

mm/page_alloc.c: In function '__alloc_pages_slowpath':
mm/page_alloc.c:3565:15: error: 'alloc_flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]

To be honest, I can't figure that out either, maybe it is or
maybe not, but moving the existing initialization up a little
higher looks safe and makes it obvious to both me and gcc that
the initialization comes before the first use.

Fixes: 74eaa4a97e8e ("mm: consolidate GFP_NOFAIL checks in the allocator slowpath")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: David Rientjes <rientjes@google.com>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help