History

libceph: kfree() in put_osd() shouldn't depend on authorizer

a255651d4cad ("ceph: ensure auth ops are defined before use") made kfree() in put_osd() conditional on the authorizer. A mechanical mistake most likely - fix it.

Ilya Dryomov committed 11 years ago

Commit b28ec2f1 parent 7eb71e01 file · +3 −2Browse files

Unified · Split

net/ceph/osd_client.c+3−2
@@ -1035,10 +1035,11 @@ static void put_osd(struct ceph_osd *osd) · 1034 unmodified lines
10351035 {
10361036 dout("put_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref),
10371037 atomic_read(&osd->o_ref) - 1);
1038− if (atomic_dec_and_test(&osd->o_ref) && osd->o_auth.authorizer) {
1038+ if (atomic_dec_and_test(&osd->o_ref)) {
10391039 struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth;
10401040
1041− ceph_auth_destroy_authorizer(ac, osd->o_auth.authorizer);
1041+ if (osd->o_auth.authorizer)
1042+ ceph_auth_destroy_authorizer(ac, osd->o_auth.authorizer);
10421043 kfree(osd);
10431044 }
10441045 }