From: Ilya Dryomov Date: Mon, 16 Feb 2015 08:49:42 +0000 (+0300) Subject: libceph: kfree() in put_osd() shouldn't depend on authorizer X-Git-Tag: v3.16.36~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=20b8129105b2e2d6288dd274f2528b19aaa888c4;p=thirdparty%2Fkernel%2Fstable.git libceph: kfree() in put_osd() shouldn't depend on authorizer commit b28ec2f37e6a2bbd0bdf74b39cb89c74e4ad17f3 upstream. 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 Signed-off-by: Ilya Dryomov Reviewed-by: Sage Weil Reviewed-by: Alex Elder Signed-off-by: Ben Hutchings --- diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 446548de09f86..dddd32775d7b4 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -993,10 +993,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); } }