summaryrefslogtreecommitdiff
path: root/net/ceph/auth.c
diff options
context:
space:
mode:
authorzuoqilin <zuoqilin@yulong.com>2021-06-10 17:45:05 +0800
committerIlya Dryomov <idryomov@gmail.com>2021-06-28 23:49:25 +0200
commitda6ebb4d67d93e16824f82cc47214825491d8e7a (patch)
tree4ad380cabd0160537531d4779c6766a5f3974d31 /net/ceph/auth.c
parent1e6de263d1164bf1361c4ee3f1252730daba96d1 (diff)
libceph: remove unnecessary ret variable in ceph_auth_init()
There is no necessary to define variable assignment, just return directly to simplify the steps. Signed-off-by: zuoqilin <zuoqilin@yulong.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph/auth.c')
-rw-r--r--net/ceph/auth.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/ceph/auth.c b/net/ceph/auth.c
index d2b268a1838e..d38c9eadbe2f 100644
--- a/net/ceph/auth.c
+++ b/net/ceph/auth.c
@@ -58,12 +58,10 @@ struct ceph_auth_client *ceph_auth_init(const char *name,
const int *con_modes)
{
struct ceph_auth_client *ac;
- int ret;
- ret = -ENOMEM;
ac = kzalloc(sizeof(*ac), GFP_NOFS);
if (!ac)
- goto out;
+ return ERR_PTR(-ENOMEM);
mutex_init(&ac->mutex);
ac->negotiating = true;
@@ -78,9 +76,6 @@ struct ceph_auth_client *ceph_auth_init(const char *name,
dout("%s name '%s' preferred_mode %d fallback_mode %d\n", __func__,
ac->name, ac->preferred_mode, ac->fallback_mode);
return ac;
-
-out:
- return ERR_PTR(ret);
}
void ceph_auth_destroy(struct ceph_auth_client *ac)