]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include,messages,rbd: Initialize counter,group_pool 17774/head
authoramitkuma <amitkuma@redhat.com>
Mon, 18 Sep 2017 13:50:23 +0000 (19:20 +0530)
committeramitkuma <amitkuma@redhat.com>
Tue, 26 Sep 2017 18:02:42 +0000 (23:32 +0530)
Fixes the coverity issues:

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

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/cls/rbd/cls_rbd_types.h
src/include/buffer.h
src/messages/MDataPing.h

index a7924e3253d484e96a9fb01d77aed5b656f14ceb..b82bf452e5195542c1873d7a72be7c53e82bedb8 100644 (file)
@@ -256,7 +256,7 @@ struct GroupSnapshotNamespace {
                                                        group_id(_group_id),
                                                        snapshot_id(_snapshot_id) {}
 
-  int64_t group_pool;
+  int64_t group_pool = 0;
   string group_id;
   snapid_t snapshot_id;
 
index 306448bed4106fbcbf72bdd98597ff11450ed755..a85a5168ecf35e1c8bda54f1fcfa93b3887f8e1c 100644 (file)
@@ -593,7 +593,6 @@ namespace buffer CEPH_BUFFER_API {
 
     class page_aligned_appender {
       bufferlist *pbl;
-      size_t offset;
       unsigned min_alloc;
       ptr buffer;
       char *pos, *end;
index 0202d78b196a5dc8d64b12cbc38b6fb9eb65a54b..8fdde1ec6f4efae30a2d4f3e27ff360d74e6dfeb 100644 (file)
@@ -36,7 +36,7 @@ class MDataPing : public Message {
   static const int COMPAT_VERSION = 1;
 
   std::string tag;
-  uint32_t counter;
+  uint32_t counter = 0;
   mdata_hook_func mdata_hook;
   struct xio_reg_mem mp;
   bool free_data;