for (i = 0; i < IB_UMAD_MAX_AGENTS; ++i) if (file->agent[i]) ib_unregister_mad_agent(file->agent[i]); 
down_write(&file->port->mutex);  already_dead = file->agents_dead; file->agents_dead = 1; 
static int ib_umad_close(struct inode *inode, struct file *filp){	struct ib_umad_file *file = filp->private_data;	struct ib_umad_device *dev = file->port->umad_dev;	struct ib_umad_packet *packet, *tmp;	int i;	for (i = 0; i < IB_UMAD_MAX_AGENTS; ++i)		if (file->agent[i])			ib_unregister_mad_agent(file->agent[i]);	list_for_each_entry_safe(packet, tmp, &file->recv_list, list)		kfree(packet);	down_write(&file->port->mutex);	list_del(&file->port_list);	up_write(&file->port->mutex);	kfree(file);	kref_put(&dev->ref, ib_umad_release_dev);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/94382f3562e350ed7c8f7dcd6fc968bdece31328/user_mad.c/clean/drivers/infiniband/core/user_mad.c