]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: Initialization of member variables 17670/head
authoramitkuma <amitkuma@redhat.com>
Tue, 12 Sep 2017 18:41:59 +0000 (00:11 +0530)
committeramitkuma <amitkuma@redhat.com>
Tue, 12 Sep 2017 18:41:59 +0000 (00:11 +0530)
Fixes the coverity issues:

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

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

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

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/messages/MInodeFileCaps.h
src/messages/MLock.h
src/messages/MLogAck.h

index e10c35c24160335810eff6cc9cdce8b5225d2e01..73cc5623ec2fd920552ed1cb021276bb7d7891e3 100644 (file)
@@ -18,7 +18,7 @@
 
 class MInodeFileCaps : public Message {
   inodeno_t ino;
-  __u32     caps;
+  __u32     caps = 0;
 
  public:
   inodeno_t get_ino() { return ino; }
index 9ca205d3a0faeea6e37afa029ca2e9a38d12841a..44ccb4f2c21b4df5b5542d9490a1a1b6993709f0 100644 (file)
 #include "mds/locks.h"
 
 class MLock : public Message {
-  int32_t     action;  // action type
-  int32_t     asker;  // who is initiating this request
+  int32_t     action = 0;  // action type
+  int32_t     asker = 0;  // who is initiating this request
   metareqid_t reqid;  // for remote lock requests
   
-  __u16      lock_type;  // lock object type
+  __u16      lock_type = 0;  // lock object type
   MDSCacheObjectInfo object_info;  
   
   bufferlist lockdata;  // and possibly some data
index 7ec173fa2926882112a4203b030c9a4143d891b0..fa7b4e53445369c5d9fdc7992d958b45a2265ec0 100644 (file)
@@ -18,7 +18,7 @@
 class MLogAck : public Message {
 public:
   uuid_d fsid;
-  version_t last;
+  version_t last = 0;
   std::string channel;
 
   MLogAck() : Message(MSG_LOGACK) {}