- if (table_info == *tablep) {
- /* data fit in-line; nothing to deallocate */
-
- *tableCntp = table_actual;
- } else if (table_actual == 0) {
- kmem_free(ipc_kernel_map, table_addr, table_size);
-
- *tableCntp = 0;
- } else {
- vm_size_t size_used, rsize_used;
- vm_map_copy_t copy;
-
- /* kmem_alloc doesn't zero memory */
-
- size_used = table_actual * sizeof *table_info;
- rsize_used = round_page(size_used);
-
- if (rsize_used != table_size)
- kmem_free(ipc_kernel_map,
- table_addr + rsize_used,
- table_size - rsize_used);
-
- if (size_used != rsize_used)
- bzero((char *) (table_addr + size_used),
- rsize_used - size_used);
+ /* prepare the table out-of-line data for return */
+ if (table_size > 0) {
+ if (table_size > infop->iis_table_size * sizeof(ipc_info_name_t))
+ bzero((char *)&table_info[infop->iis_table_size],
+ table_size - infop->iis_table_size * sizeof(ipc_info_name_t));