]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd,test: Initialize m_snap_list_ret,m_,value 17825/head
authoramitkuma <amitkuma@redhat.com>
Wed, 20 Sep 2017 12:00:39 +0000 (17:30 +0530)
committeramitkuma <amitkuma@redhat.com>
Wed, 20 Sep 2017 12:00:39 +0000 (17:30 +0530)
Fixes the coverity issues:

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

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

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/librbd/operation/ObjectMapIterate.cc
src/test/common/test_sharedptr_registry.cc
src/test/objectstore/BitAllocator_test.cc

index 1e4b854bddd500f8e0ff7d77427ee42d3c2aab0e..e73e0bc9b7b3e730c982ad557a246c4959fb3925 100644 (file)
@@ -68,7 +68,7 @@ private:
   std::atomic_flag *m_invalidate;
 
   librados::snap_set_t m_snap_set;
-  int m_snap_list_ret;
+  int m_snap_list_ret = 0;
 
   bool should_complete(int r) {
     I &image_ctx = this->m_image_ctx;
index 078259971e2bf0f698df4344fc70cd47c0ceac14..ee61e5cb6e5cb7d528be384a9cfb57d285b2102b 100644 (file)
@@ -300,7 +300,7 @@ public:
     TellDie() { died = NO; }
     ~TellDie() { died = YES; }
     
-    int value;
+    int value = 0;
   };
 
   void SetUp() override {
index 2ed8d81a442b84b4bd30e85c8c8ef322c11ac162..34a3a4a7e5c342e5517755ad9eeb1753949390e9 100644 (file)
@@ -25,8 +25,8 @@ TEST(BitAllocator, test_bmap_iter)
   int off = 2;
 
   class BmapEntityTmp {
-      int64_t m_num;
-      int64_t m_len;
+      int64_t m_num = 0;
+      int64_t m_len = 0;
     public:
       void init(int index) {
         m_num = index;