From: Rusty Russell Date: Sat, 25 Sep 2010 12:34:16 +0000 (+0930) Subject: alloc: fix uninitialized entry (thanks valgrind!) X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=e58a81a861ab3e6593b6f4962256f45d3da781aa alloc: fix uninitialized entry (thanks valgrind!) --- diff --git a/ccan/alloc/alloc.c b/ccan/alloc/alloc.c index 8e0b72aa..6cd96d8d 100644 --- a/ccan/alloc/alloc.c +++ b/ccan/alloc/alloc.c @@ -489,6 +489,8 @@ static unsigned long break_up_large_page(struct header *head, for (i = 1; i < SMALL_PAGES_PER_LARGE_PAGE; i++) { struct page_header *ph = from_pgnum(head, lpage + i, sp_bits); + /* Initialize this: huge_alloc reads it. */ + ph->elements_used = 0; add_small_page_to_freelist(head, ph, sp_bits); }