aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiaofei Tan <tanxiaofei@huawei.com>2021-05-06 16:51:46 +0800
committerJason Gunthorpe <jgg@nvidia.com>2021-05-11 13:17:26 -0300
commite3d65124ce2bf43f2d65f925e590482bd676f2f4 (patch)
treef027936b95e567e17359ba8c013afb3eef360906
parentRDMA/hns: Remove the condition of light load for posting DWQE (diff)
downloadlinux-dev-e3d65124ce2bf43f2d65f925e590482bd676f2f4.tar.xz
linux-dev-e3d65124ce2bf43f2d65f925e590482bd676f2f4.zip
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>
-rw-r--r--drivers/infiniband/core/ucma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 15d57ba4d07a..1f198c180aa1 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -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);