]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages,test,msg: Initializing h,reply_type,owner 17767/head
authoramitkuma <amitkuma@redhat.com>
Sun, 17 Sep 2017 07:05:26 +0000 (12:35 +0530)
committeramitkuma <amitkuma@redhat.com>
Sun, 17 Sep 2017 07:05:26 +0000 (12:35 +0530)
Fixes the coverity issues:

** 717326 Uninitialized scalar field
2. uninit_member: Non-static class member field h.fsid is not initialized
in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member field h.version is not initialized
in this constructor nor in any functions that it calls.
CID 717326 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
6. uninit_member: Non-static class member field h.st is not initialized in
this constructor nor in any functions that it calls.

** 1244199 Uninitialized scalar field
CID 1244199 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member reply_type is not initialized
in this constructor nor in any functions that it calls.

** 1249637 Uninitialized scalar field
CID 1249637 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member owner is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/messages/MStatfsReply.h
src/msg/async/Event.h
src/test/mon/test-mon-msg.cc

index dd9690dad6a3c6a2ac53c171c3ebcd951a83a01b..195a369e15ea7ace7e5e9077bc0ff71fa5366bb6 100644 (file)
@@ -18,7 +18,7 @@
 
 class MStatfsReply : public Message {
 public:
-  struct ceph_mon_statfs_reply h;
+  struct ceph_mon_statfs_reply h{};
 
   MStatfsReply() : Message(CEPH_MSG_STATFS_REPLY) {}
   MStatfsReply(uuid_d &f, ceph_tid_t t, epoch_t epoch) : Message(CEPH_MSG_STATFS_REPLY) {
index b4743c1b278d223a570251e449f11726c3392b9c..1ccff4bb333e477a72e50093f82a022810a9dc71 100644 (file)
@@ -155,7 +155,7 @@ class EventCenter {
   std::string type;
   int nevent;
   // Used only to external event
-  pthread_t owner;
+  pthread_t owner = 0;
   std::mutex external_lock;
   std::atomic_ulong external_num_events;
   deque<EventCallbackRef> external_events;
index 66fab30d07ac20d562fe06cae1eb0333dccf49ed..83c049b70e17c3d82da4697c3d7617b3b7e21c98 100644 (file)
@@ -219,7 +219,7 @@ class MonMsgTest : public MonClientHelper,
                    public ::testing::Test
 {
 protected:
-  int reply_type;
+  int reply_type = 0;
   Message *reply_msg = nullptr;
   Mutex lock;
   Cond cond;