int __exit mipv6_shutdown_bcache() { unsigned long flags; struct mipv6_bcache_entry *entry; DEBUG_FUNC(); write_lock_irqsave(&bcache->lock, flags); DEBUG((DBG_INFO, "mipv6_shutdown_bcache: Stopping the timer")); del_timer(&bcache->callback_timer); while ((entry = (struct mipv6_bcache_entry *) hashlist_get_first(bcache->entries)) != NULL) { DEBUG_FUNC(); /* hashlist_delete_first(bcache->entries); */ bcache_proxy_nd_rem(entry); hashlist_delete(bcache->entries, &entry->home_addr); mipv6_bcache_entry_free(entry); DEBUG_FUNC(); } hashlist_destroy(bcache->entries); mipv6_free_allocation_pool(bcache->entry_pool); #ifdef CONFIG_PROC_FS proc_net_remove("mip6_bcache"); #endif /* Lock must be released before freeing the memory. */ write_unlock_irqrestore(&bcache->lock, flags); kfree(bcache); return 0; }
int __exit mipv6_shutdown_halist(void) { unsigned long flags; DEBUG_FUNC(); write_lock_irqsave(&home_agents->lock, flags); DEBUG((DBG_INFO, "mipv6_shutdown_halist: Stopping the timer")); del_timer(&home_agents->expire_timer); mipv6_halist_gc(1); hashlist_destroy(home_agents->entries); #ifdef CONFIG_PROC_FS proc_net_remove("mip6_home_agents"); #endif /* Lock must be released before freeing the memory. */ write_unlock_irqrestore(&home_agents->lock, flags); kfree(home_agents); return 0; }