ctx->cm_id             = uevent->cm_id; ctx->cm_id->cm_handler = ib_ucm_event_handler; ctx->cm_id->context    = (void *)(unsigned long)ctx->id; 
ctx->cm_id          = uevent->cm_id; ctx->cm_id->context = ctx; 
static ssize_t ib_ucm_event(struct ib_ucm_file *file,			    const char __user *inbuf,			    int in_len, int out_len){	struct ib_ucm_context *ctx;	struct ib_ucm_event_get cmd;	struct ib_ucm_event *uevent = NULL;	int result = 0;	DEFINE_WAIT(wait);	if (out_len < sizeof(struct ib_ucm_event_resp))		return -ENOSPC;	if (copy_from_user(&cmd, inbuf, sizeof(cmd)))		return -EFAULT;	/*	 * wait	 */	down(&file->mutex);	while (list_empty(&file->events)) {		if (file->filp->f_flags & O_NONBLOCK) {			result = -EAGAIN;			break;		}		if (signal_pending(current)) {			result = -ERESTARTSYS;			break;		}		prepare_to_wait(&file->poll_wait, &wait, TASK_INTERRUPTIBLE);		up(&file->mutex);		schedule();		down(&file->mutex);		finish_wait(&file->poll_wait, &wait);	}	if (result)		goto done;	uevent = list_entry(file->events.next, struct ib_ucm_event, file_list);	if (!uevent->cm_id)		goto user;	ctx = ib_ucm_ctx_alloc(file);	if (!ctx) {		result = -ENOMEM;		goto done;	}	ctx->cm_id             = uevent->cm_id;	ctx->cm_id->cm_handler = ib_ucm_event_handler;	ctx->cm_id->context    = (void *)(unsigned long)ctx->id;	uevent->resp.id = ctx->id;user:	if (copy_to_user((void __user *)(unsigned long)cmd.response,			 &uevent->resp, sizeof(uevent->resp))) {		result = -EFAULT;		goto done;	}	if (uevent->data) {		if (cmd.data_len < uevent->data_len) {			result = -ENOMEM;			goto done;		}		if (copy_to_user((void __user *)(unsigned long)cmd.data,				 uevent->data, uevent->data_len)) {			result = -EFAULT;			goto done;		}	}	if (uevent->info) {		if (cmd.info_len < uevent->info_len) {			result = -ENOMEM;			goto done;		}		if (copy_to_user((void __user *)(unsigned long)cmd.info,				 uevent->info, uevent->info_len)) {			result = -EFAULT;			goto done;		}	}	list_del(&uevent->file_list);	list_del(&uevent->ctx_list);	kfree(uevent->data);	kfree(uevent->info);	kfree(uevent);done:	up(&file->mutex);	return result;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b9ef520f9caf20aba8ac7cb2bbba45b52ff19d53/ucm.c/clean/drivers/infiniband/core/ucm.c