Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3abf7afd authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

dequeue_huge_page() warning fix



mm/hugetlb.c: In function `dequeue_huge_page':
mm/hugetlb.c:72: warning: 'nid' might be used uninitialized in this function

Cc: Christoph Lameter <clameter@sgi.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: David Gibson <hermes@gibson.dropbear.id.au>
Cc: William Lee Irwin III <wli@holomorphy.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dd00cc48
Loading
Loading
Loading
Loading
+7 −10
Original line number Original line Diff line number Diff line
@@ -78,17 +78,14 @@ static struct page *dequeue_huge_page(struct vm_area_struct *vma,
	for (z = zonelist->zones; *z; z++) {
	for (z = zonelist->zones; *z; z++) {
		nid = zone_to_nid(*z);
		nid = zone_to_nid(*z);
		if (cpuset_zone_allowed_softwall(*z, htlb_alloc_mask) &&
		if (cpuset_zone_allowed_softwall(*z, htlb_alloc_mask) &&
		    !list_empty(&hugepage_freelists[nid]))
		    !list_empty(&hugepage_freelists[nid])) {
			break;
	}

	if (*z) {
			page = list_entry(hugepage_freelists[nid].next,
			page = list_entry(hugepage_freelists[nid].next,
					  struct page, lru);
					  struct page, lru);
			list_del(&page->lru);
			list_del(&page->lru);
			free_huge_pages--;
			free_huge_pages--;
			free_huge_pages_node[nid]--;
			free_huge_pages_node[nid]--;
		}
		}
	}
	return page;
	return page;
}
}