/* Device is about to be destroyed: clean up.  */
void ip_mc_destroy_dev(struct in_device *in_dev)
/* Device is about to be destroyed: clean up.  */
void ip_mc_destroy_dev(struct in_device *in_dev)
{
	struct ip_mc_list *i;
	ASSERT_RTNL();
	ip_mc_down(in_dev);
	write_lock_bh(&in_dev->mc_list_lock);
	while ((i = in_dev->mc_list) != NULL) {
		in_dev->mc_list = i->next;
		in_dev->mc_count--;
		write_unlock_bh(&in_dev->mc_list_lock);
		igmp_group_dropped(i);
		ip_ma_put(i);
		write_lock_bh(&in_dev->mc_list_lock);
	}
	write_unlock_bh(&in_dev->mc_list_lock);
}