From 5bb1b169757875a72e05bfcbb76e22602cb1a760 Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Thu, 19 May 2016 17:13:50 -0700 Subject: [PATCH] mm, page_alloc: remove unnecessary initialisation from __alloc_pages_nodemask() page is guaranteed to be set before it is read with or without the initialisation. [akpm@linux-foundation.org: fix warning] Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka Cc: Jesper Dangaard Brouer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/page_alloc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1096ac8f5ed1..f9ca6cc553c7 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3347,7 +3347,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, struct zonelist *zonelist, nodemask_t *nodemask) { struct zoneref *preferred_zoneref; - struct page *page = NULL; + struct page *page; unsigned int cpuset_mems_cookie; unsigned int alloc_flags = ALLOC_WMARK_LOW|ALLOC_FAIR; gfp_t alloc_mask; /* The gfp_t that was actually used for allocation */ @@ -3393,8 +3393,11 @@ retry_cpuset: /* The preferred zone is used for statistics later */ preferred_zoneref = first_zones_zonelist(ac.zonelist, ac.high_zoneidx, ac.nodemask, &ac.preferred_zone); - if (!ac.preferred_zone) + if (!ac.preferred_zone) { + page = NULL; goto out; + } + ac.classzone_idx = zonelist_zone_idx(preferred_zoneref); /* First allocation attempt */ -- 2.30.2