]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: Initializing class members in module msg 17568/head
authoramitkuma <amitkuma@redhat.com>
Thu, 7 Sep 2017 18:51:35 +0000 (00:21 +0530)
committeramitkuma <amitkuma@redhat.com>
Thu, 7 Sep 2017 18:51:35 +0000 (00:21 +0530)
Fixes the coverity issues:

** 1414530 Uninitialized pointer field
2. uninit_member: Non-static class member tx_cq is not initialized
in this constructor nor in any functions that it calls.
4. uninit_member: Non-static class member rx_cq is not initialized
in this constructor nor in any functions that it calls.
6. uninit_member: Non-static class member tx_cc is not initialized
in this constructor nor in any functions that it calls.
CID 1414530 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
8. uninit_member: Non-static class member rx_cc is not initialized
in this constructor nor in any functions that it calls.

** 1416369 Uninitialized pointer field
CID 1416369 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
4. uninit_member: Non-static class member send is not initialized
in this constructor nor in any functions that it calls.

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/msg/DispatchStrategy.h
src/msg/async/rdma/Infiniband.h
src/msg/async/rdma/RDMAStack.h

index 44d63d473688e86c15b1ae1f367f57bad213a626..4c9726ed635c1458af5541a1d1c9f2bb3e214350 100644 (file)
@@ -22,7 +22,7 @@ class Messenger;
 class DispatchStrategy
 {
 protected:
-  Messenger *msgr;
+  Messenger *msgr = nullptr;
 public:
   DispatchStrategy() {}
   Messenger *get_messenger() { return msgr; }
index 00ee99b8c8ad6ad3c01c8c3d9267e1cc12454bb1..fff706df4f823081d66fcc6ffeb251709e83c659 100644 (file)
@@ -340,7 +340,7 @@ class Infiniband {
     // TODO: Cluster -> TxPool txbuf_pool
     // chunk layout fix
     //  
-    Cluster* send;// SEND
+    Cluster* send = nullptr;// SEND
     Device *device;
     ProtectionDomain *pd;
     MemPoolContext rxbuf_pool_ctx;
index 6869d32ef0b18476c36c5ea9c489b50aa330b81e..74cc94a5a4e6c8836f57fb488227e49ba28b2bfb 100644 (file)
@@ -40,9 +40,9 @@ class RDMADispatcher {
 
   std::thread t;
   CephContext *cct;
-  Infiniband::CompletionQueue* tx_cq;
-  Infiniband::CompletionQueue* rx_cq;
-  Infiniband::CompletionChannel *tx_cc, *rx_cc;
+  Infiniband::CompletionQueue* tx_cq = nullptr;
+  Infiniband::CompletionQueue* rx_cq = nullptr;
+  Infiniband::CompletionChannel *tx_cc = nullptr, *rx_cc = nullptr;
   EventCallbackRef async_handler;
   bool done = false;
   std::atomic<uint64_t> num_dead_queue_pair = {0};