Skip to content

Commit

Permalink
libceph: kfree() in put_osd() shouldn't depend on authorizer
Browse files Browse the repository at this point in the history
a255651 ("ceph: ensure auth ops are defined before use") made
kfree() in put_osd() conditional on the authorizer.  A mechanical
mistake most likely - fix it.

Cc: Alex Elder <elder@linaro.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Alex Elder <elder@linaro.org>
  • Loading branch information
Ilya Dryomov committed Feb 19, 2015
1 parent 7eb71e0 commit b28ec2f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,10 +1035,11 @@ static void put_osd(struct ceph_osd *osd)
{
dout("put_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref),
atomic_read(&osd->o_ref) - 1);
if (atomic_dec_and_test(&osd->o_ref) && osd->o_auth.authorizer) {
if (atomic_dec_and_test(&osd->o_ref)) {
struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth;

ceph_auth_destroy_authorizer(ac, osd->o_auth.authorizer);
if (osd->o_auth.authorizer)
ceph_auth_destroy_authorizer(ac, osd->o_auth.authorizer);
kfree(osd);
}
}
Expand Down

0 comments on commit b28ec2f

Please sign in to comment.