down(&ctx->file->mutex); if (ctx->file != file) result = -EINVAL; else result = ib_send_cm_sidr_req(ctx->cm_id, &param);  up(&ctx->file->mutex); ib_ucm_ctx_put(ctx);
static ssize_t ib_ucm_send_sidr_req(struct ib_ucm_file *file,				    const char __user *inbuf,				    int in_len, int out_len){	struct ib_cm_sidr_req_param param;	struct ib_ucm_context *ctx;	struct ib_ucm_sidr_req cmd;	int result;	param.private_data = NULL;	param.path = NULL;	if (copy_from_user(&cmd, inbuf, sizeof(cmd)))		return -EFAULT;	result = ib_ucm_alloc_data(&param.private_data, cmd.data, cmd.len);	if (result)		goto done;	result = ib_ucm_path_get(&param.path, cmd.path);	if (result)		goto done;	param.private_data_len = cmd.len;	param.service_id       = cmd.sid;	param.timeout_ms       = cmd.timeout;	param.max_cm_retries   = cmd.max_cm_retries;	param.pkey             = cmd.pkey;	ctx = ib_ucm_ctx_get(cmd.id);	if (!ctx) {		result = -ENOENT;		goto done;	} 	down(&ctx->file->mutex);	if (ctx->file != file)		result = -EINVAL;	else		result = ib_send_cm_sidr_req(ctx->cm_id, &param);	up(&ctx->file->mutex);	ib_ucm_ctx_put(ctx); /* func reference */done:	kfree(param.private_data);	kfree(param.path);	return result;}