RDMA/ucma: Cleanup to reduce duplicate code
The lable "err1" does the same thing as the branch of copy_to_user() failed in the function ucma_create_id(). Just jump to the label directly to reduce duplicate code. Link: https://lore.kernel.org/r/1620291106-3675-1-git-send-email-tanxiaofei@huawei.com Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
591f762b27
commit
e3d65124ce
@ -468,8 +468,8 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf,
|
||||
resp.id = ctx->id;
|
||||
if (copy_to_user(u64_to_user_ptr(cmd.response),
|
||||
&resp, sizeof(resp))) {
|
||||
ucma_destroy_private_ctx(ctx);
|
||||
return -EFAULT;
|
||||
ret = -EFAULT;
|
||||
goto err1;
|
||||
}
|
||||
|
||||
mutex_lock(&file->mut);
|
||||
|
Loading…
x
Reference in New Issue
Block a user