aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ceph/auth_x.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/ceph/auth_x.c b/fs/ceph/auth_x.c
index 96e7aaa77678..33d3ad4dc456 100644
--- a/fs/ceph/auth_x.c
+++ b/fs/ceph/auth_x.c
@@ -156,6 +156,7 @@ static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
156 struct timespec validity; 156 struct timespec validity;
157 struct ceph_crypto_key old_key; 157 struct ceph_crypto_key old_key;
158 void *tp, *tpend; 158 void *tp, *tpend;
159 struct ceph_buffer *new_ticket_blob;
159 160
160 ceph_decode_need(&p, end, sizeof(u32) + 1, bad); 161 ceph_decode_need(&p, end, sizeof(u32) + 1, bad);
161 162
@@ -223,9 +224,12 @@ static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
223 ceph_decode_need(&tp, tpend, 1 + sizeof(u64), bad); 224 ceph_decode_need(&tp, tpend, 1 + sizeof(u64), bad);
224 struct_v = ceph_decode_8(&tp); 225 struct_v = ceph_decode_8(&tp);
225 th->secret_id = ceph_decode_64(&tp); 226 th->secret_id = ceph_decode_64(&tp);
226 ret = ceph_decode_buffer(&th->ticket_blob, &tp, tpend); 227 ret = ceph_decode_buffer(&new_ticket_blob, &tp, tpend);
227 if (ret) 228 if (ret)
228 goto out; 229 goto out;
230 if (th->ticket_blob)
231 ceph_buffer_put(th->ticket_blob);
232 th->ticket_blob = new_ticket_blob;
229 dout(" got ticket service %d (%s) secret_id %lld len %d\n", 233 dout(" got ticket service %d (%s) secret_id %lld len %d\n",
230 type, ceph_entity_type_name(type), th->secret_id, 234 type, ceph_entity_type_name(type), th->secret_id,
231 (int)th->ticket_blob->vec.iov_len); 235 (int)th->ticket_blob->vec.iov_len);