aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-05-12 17:18:42 -0400
committerSage Weil <sage@newdream.net>2011-05-19 14:25:02 -0400
commite8f54ce169125a2e59330fac25ad3c9ac0ce22a5 (patch)
tree10184a12eb50d98245f6e218efb631ada132ca8e /net/ceph
parent1b36698577c1008dc1e63f0bf4b6f3d9deada94a (diff)
libceph: fix uninitialized value when no get_authorizer method is set
If there is no get_authorizer method we set the out_kvec to a bogus pointer. The length is also zero in that case, so it doesn't much matter, but it's better not to add the empty item in the first place. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/messenger.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index b140dd3515de..ce326c806237 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -619,11 +619,12 @@ static int prepare_connect_authorizer(struct ceph_connection *con)
619 con->out_connect.authorizer_protocol = cpu_to_le32(auth_protocol); 619 con->out_connect.authorizer_protocol = cpu_to_le32(auth_protocol);
620 con->out_connect.authorizer_len = cpu_to_le32(auth_len); 620 con->out_connect.authorizer_len = cpu_to_le32(auth_len);
621 621
622 con->out_kvec[con->out_kvec_left].iov_base = auth_buf; 622 if (auth_len) {
623 con->out_kvec[con->out_kvec_left].iov_len = auth_len; 623 con->out_kvec[con->out_kvec_left].iov_base = auth_buf;
624 con->out_kvec_left++; 624 con->out_kvec[con->out_kvec_left].iov_len = auth_len;
625 con->out_kvec_bytes += auth_len; 625 con->out_kvec_left++;
626 626 con->out_kvec_bytes += auth_len;
627 }
627 return 0; 628 return 0;
628} 629}
629 630