Commit da6ebb4d authored by zuoqilin's avatar zuoqilin Committed by Ilya Dryomov

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: default avatarzuoqilin <zuoqilin@yulong.com>
Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 1e6de263
...@@ -58,12 +58,10 @@ struct ceph_auth_client *ceph_auth_init(const char *name, ...@@ -58,12 +58,10 @@ struct ceph_auth_client *ceph_auth_init(const char *name,
const int *con_modes) const int *con_modes)
{ {
struct ceph_auth_client *ac; struct ceph_auth_client *ac;
int ret;
ret = -ENOMEM;
ac = kzalloc(sizeof(*ac), GFP_NOFS); ac = kzalloc(sizeof(*ac), GFP_NOFS);
if (!ac) if (!ac)
goto out; return ERR_PTR(-ENOMEM);
mutex_init(&ac->mutex); mutex_init(&ac->mutex);
ac->negotiating = true; ac->negotiating = true;
...@@ -78,9 +76,6 @@ struct ceph_auth_client *ceph_auth_init(const char *name, ...@@ -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__, dout("%s name '%s' preferred_mode %d fallback_mode %d\n", __func__,
ac->name, ac->preferred_mode, ac->fallback_mode); ac->name, ac->preferred_mode, ac->fallback_mode);
return ac; return ac;
out:
return ERR_PTR(ret);
} }
void ceph_auth_destroy(struct ceph_auth_client *ac) void ceph_auth_destroy(struct ceph_auth_client *ac)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment