wake_up_interruptible(&ctx->file->poll_wait);  up(&ctx->file->mutex); done: ctx->error = result; ib_ucm_ctx_put(ctx); /* func reference */ return result; 
err2: kfree(uevent); err1: /* Destroy new cm_id's */ return (id == IB_UCM_CM_ID_INVALID); 
static int ib_ucm_event_handler(struct ib_cm_id *cm_id,				struct ib_cm_event *event){	struct ib_ucm_event *uevent;	struct ib_ucm_context *ctx;	int result = 0;	int id;	/*	 * lookup correct context based on event type.	 */	switch (event->event) {	case IB_CM_REQ_RECEIVED:		id = (long)event->param.req_rcvd.listen_id->context;		break;	case IB_CM_SIDR_REQ_RECEIVED:		id = (long)event->param.sidr_req_rcvd.listen_id->context;		break;	default:		id = (long)cm_id->context;		break;	}	ucm_dbg("Event. CM ID <%d> event <%d>\n", id, event->event);	ctx = ib_ucm_ctx_get(id);	if (!ctx)		return -ENOENT;	if (event->event == IB_CM_REQ_RECEIVED ||	    event->event == IB_CM_SIDR_REQ_RECEIVED)		id = IB_UCM_CM_ID_INVALID;	uevent = kmalloc(sizeof(*uevent), GFP_KERNEL);	if (!uevent) {		result = -ENOMEM;		goto done;	}	memset(uevent, 0, sizeof(*uevent));	uevent->resp.id    = id;	uevent->resp.event = event->event;	result = ib_ucm_event_process(event, uevent);	if (result)		goto done;	uevent->ctx   = ctx;	uevent->cm_id = ((event->event == IB_CM_REQ_RECEIVED ||			  event->event == IB_CM_SIDR_REQ_RECEIVED ) ?			 cm_id : NULL);	down(&ctx->file->mutex);	list_add_tail(&uevent->file_list, &ctx->file->events);	list_add_tail(&uevent->ctx_list, &ctx->events);	wake_up_interruptible(&ctx->file->poll_wait);	up(&ctx->file->mutex);done:	ctx->error = result;	ib_ucm_ctx_put(ctx); /* func reference */	return result;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b9ef520f9caf20aba8ac7cb2bbba45b52ff19d53/ucm.c/clean/drivers/infiniband/core/ucm.c