ib_unregister_mad_agent(file->agent[i]);
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;	down_write(&file->port->mutex);	for (i = 0; i < IB_UMAD_MAX_AGENTS; ++i)		if (file->agent[i]) {			ib_dereg_mr(file->mr[i]);			ib_unregister_mad_agent(file->agent[i]);		}	list_for_each_entry_safe(packet, tmp, &file->recv_list, list)		kfree(packet);	list_del(&file->port_list);	up_write(&file->port->mutex);	kfree(file);	kref_put(&dev->ref, ib_umad_release_dev);	return 0;}