+
+ /* free buffers for large arrays used by atp.
+ * to prevent a race condition if the funnel is dropped
+ * while calling kmem_free, the fields are grabbed and
+ * zeroed first.
+ */
+ if (atp_rcb_data != NULL) {
+ temp_rcb_data = (vm_offset_t)atp_rcb_data;
+ atp_rcb_data = NULL;
+ atp_rcb_free_list = NULL;
+ } else
+ temp_rcb_data = NULL;
+ if (atp_state_data != NULL) {
+ temp_state_data = (vm_offset_t)atp_state_data;
+ atp_state_data = NULL;
+ atp_free_list = NULL;
+ } else
+ temp_state_data = NULL;
+
+ if (temp_rcb_data)
+ kmem_free(kernel_map, temp_rcb_data, sizeof(struct atp_rcb) * NATP_RCB);
+ if (temp_state_data)
+ kmem_free(kernel_map, temp_state_data, sizeof(struct atp_state) * NATP_STATE);