The same situation as the previous patch. * vm/vm_debug.c (host_virtual_physical_table_info) (size): Don't initialize to zero. (host_virtual_physical_table_info) (size): Move initialization before the break statement.
--- vm/vm_debug.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vm/vm_debug.c b/vm/vm_debug.c index e4a4b8b..850547b 100644 --- a/vm/vm_debug.c +++ b/vm/vm_debug.c @@ -439,7 +439,7 @@ host_virtual_physical_table_info(host, infop, countp) natural_t *countp; { vm_offset_t addr; - vm_size_t size = 0;/* '=0' to quiet gcc warnings */ + vm_size_t size; hash_info_bucket_t *info; unsigned int potential, actual; kern_return_t kr; @@ -454,6 +454,9 @@ host_virtual_physical_table_info(host, infop, countp) for (;;) { actual = vm_page_info(info, potential); + + size = round_page(actual * sizeof *info); + if (actual <= potential) break; @@ -462,7 +465,6 @@ host_virtual_physical_table_info(host, infop, countp) if (info != *infop) kmem_free(ipc_kernel_map, addr, size); - size = round_page(actual * sizeof *info); kr = kmem_alloc_pageable(ipc_kernel_map, &addr, size); if (kr != KERN_SUCCESS) return KERN_RESOURCE_SHORTAGE; -- 1.8.1.4