Skip to content

Commit

Permalink
libceph: remove unnecessary ret variable in ceph_auth_init()
Browse files Browse the repository at this point in the history
There is no necessary to define variable assignment, just return
directly to simplify the steps.

Signed-off-by: zuoqilin <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
zuoqilin authored and idryomov committed Jun 28, 2021
1 parent 1e6de26 commit da6ebb4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions net/ceph/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit da6ebb4

Please sign in to comment.