diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2015-02-16 03:49:42 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-02-19 06:27:51 -0500 |
commit | b28ec2f37e6a2bbd0bdf74b39cb89c74e4ad17f3 (patch) | |
tree | 0f7b68eb531e5034889da577dc05fc9ffe958b8b | |
parent | 7eb71e0351fbb1b242ae70abb7bb17107fe2f792 (diff) |
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.
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>
-rw-r--r-- | net/ceph/osd_client.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index f693a2f8ac86..41a4abc7e98e 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) | |||
1035 | { | 1035 | { |
1036 | dout("put_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref), | 1036 | dout("put_osd %p %d -> %d\n", osd, atomic_read(&osd->o_ref), |
1037 | atomic_read(&osd->o_ref) - 1); | 1037 | 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)) { |
1039 | struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth; | 1039 | struct ceph_auth_client *ac = osd->o_osdc->client->monc.auth; |
1040 | 1040 | ||
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); | ||
1042 | kfree(osd); | 1043 | kfree(osd); |
1043 | } | 1044 | } |
1044 | } | 1045 | } |