/* Release a connection structure and remove it from the list of netiucv connections.  */
static void netiucv_remove_connection(struct iucv_connection *conn)
/* Release a connection structure and remove it from the list of netiucv connections.  */
static void netiucv_remove_connection(struct iucv_connection *conn)
{
	IUCV_DBF_TEXT(trace, 3, __func__);
	write_lock_bh(&iucv_connection_rwlock);
	list_del_init(&conn->list);
	write_unlock_bh(&iucv_connection_rwlock);
	fsm_deltimer(&conn->timer);
	netiucv_purge_skb_queue(&conn->collect_queue);
	if (conn->path) {
		iucv_path_sever(conn->path, iucvMagic);
		kfree(conn->path);
		conn->path = NULL;
	}
	netiucv_purge_skb_queue(&conn->commit_queue);
	kfree_fsm(conn->fsm);
	kfree_skb(conn->rx_buff);
	kfree_skb(conn->tx_buff);
}