From a07edfff6bd5e5b8249e38097dd78cd97d34d685 Mon Sep 17 00:00:00 2001 From: amitkuma Date: Wed, 9 Aug 2017 15:41:59 +0530 Subject: [PATCH] messages: Initializing members in MOSDPGUpdateLogMissing Fixes the coverity issues: ** 1355242 Uninitialized scalar field 2. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls. 4. uninit_member: Non-static class member min_epoch is not initialized in this constructor nor in any functions that it calls. CID 1355242 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 6. uninit_member: Non-static class member rep_tid is not initialized in this constructor nor in any functions that it calls. ** 1355243 Uninitialized scalar field 2. uninit_member: Non-static class member map_epoch is not initialized in this constructor nor in any functions that it calls. 4. uninit_member: Non-static class member min_epoch is not initialized in this constructor nor in any functions that it calls. CID 1355243 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 6. uninit_member: Non-static class member rep_tid is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Amit Kumar amitkuma@redhat.com --- src/messages/MOSDPGUpdateLogMissing.h | 4 ++-- src/messages/MOSDPGUpdateLogMissingReply.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/messages/MOSDPGUpdateLogMissing.h b/src/messages/MOSDPGUpdateLogMissing.h index 7823fd08f7343..3ca37f6312409 100644 --- a/src/messages/MOSDPGUpdateLogMissing.h +++ b/src/messages/MOSDPGUpdateLogMissing.h @@ -25,10 +25,10 @@ class MOSDPGUpdateLogMissing : public MOSDFastDispatchOp { public: - epoch_t map_epoch, min_epoch; + epoch_t map_epoch = 0, min_epoch = 0; spg_t pgid; shard_id_t from; - ceph_tid_t rep_tid; + ceph_tid_t rep_tid = 0; mempool::osd_pglog::list entries; epoch_t get_epoch() const { return map_epoch; } diff --git a/src/messages/MOSDPGUpdateLogMissingReply.h b/src/messages/MOSDPGUpdateLogMissingReply.h index 8df6d9be5c84d..e50b8173b062a 100644 --- a/src/messages/MOSDPGUpdateLogMissingReply.h +++ b/src/messages/MOSDPGUpdateLogMissingReply.h @@ -25,10 +25,10 @@ class MOSDPGUpdateLogMissingReply : public MOSDFastDispatchOp { public: - epoch_t map_epoch, min_epoch; + epoch_t map_epoch = 0, min_epoch = 0; spg_t pgid; shard_id_t from; - ceph_tid_t rep_tid; + ceph_tid_t rep_tid = 0; epoch_t get_epoch() const { return map_epoch; } spg_t get_pgid() const { return pgid; } -- 2.39.5