libceph: kfree() in put_osd() shouldn't depend on authorizer
Changes
1 files changed · +3 −2
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| net/ceph/osd_client.c | modified | +3 | −2 | View file |
net/ceph/osd_client.c
View filediff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index f693a2f..41a4abc 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -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);
}
}